Forums

Home » Liferay Portal » English » 2. Using Liferay » General

Combination View Flat View Tree View
Threads [ Previous | Next ]
Philipp Schrottmail
How can I stop the Web Content WYSIWYG Editor from messing up my html?
January 22, 2013 6:45 AM
Answer

Philipp Schrottmail

Rank: New Member

Posts: 6

Join Date: December 14, 2012

Recent Posts

Hello,

My problem is the following. I want to use an area as an anchor.

1
2<a href="http://google.com">
3    <div>
4        <img src="some_image" />
5        <h1>some heading</h1>
6        <p>some text</p>
7    </div>
8</a>


The <a> tag is around a div whichs technically isn't valid in Html4 but in 5 it is. But the browsers get it so I want to use it.
How ever whenever I edit the webcontent the WYSIWYG editor is opened firtst and it has this nasty habit of changing the html as he wants.

the above code gets corrected to the following

 1
 2<p>
 3    <a href="http://google.com"> </a></p>
 4<div>
 5    <a href="http://google.com"><img src="some_image" /> </a>
 6    <h1>
 7        <a href="http://google.com">some heading</a></h1>
 8    <p>
 9        <a href="http://google.com">some text</a></p>
10</div>


The <a> tag got mulitplied by 4 and now the text and headings have hover effects which I don't want. You see where I'm getting.

Can I somehow tell the WSIWYG editor to stop this behaviour?