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

Philipp Schrottmail

Rank: New Member

Posts: 6

Join Date: December 14, 2012

Recent Posts


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

2<a href="">
3    <div>
4        <img src="some_image" />
5        <h1>some heading</h1>
6        <p>some text</p>
7    </div>

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

 3    <a href=""> </a></p>
 5    <a href=""><img src="some_image" /> </a>
 6    <h1>
 7        <a href="">some heading</a></h1>
 8    <p>
 9        <a href="">some text</a></p>

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?