Press Ctrl / CMD + C to copy this to your clipboard.
This post will be reported to the moderators as potential spam to be looked at
Hello, Im currently in Umbraco v 4.7 running on IIS 7
TinyMCE editor modifies html data when saving. How can I avoid that?
For example, I have html code:
<div id="offers"> <a class="offerItem" href="#"> <h2>Lorem Ipsum1</h2> <span>Lorem ipsum dolor...</span> </a> <div class="separator"></div> <a class="offerItem" href="#"> <h2>Lorem Ipsum2</h2> <span>Lorem ipsum dolor...</span> </a> <div class="separator"></div><a class="offerItem" href="#"> <h2>Lorem Ipsum</h2> <span>Lorem ipsum dolor...</span> </a> <div class="separator"></div></div>
When I update this content int the editor it changes my html to:
<div id="offers"><h2>Lorem Ipsum1</h2><a class="offerItem" href="#"><span>Lorem ipsum dolor...</span> </a><div class="separator"></div><h2>Lorem Ipsum2</h2><a class="offerItem" href="#"><span>Lorem ipsum dolor...</span> </a><div class="separator"></div><h2>Lorem Ipsum</h2><a class="offerItem" href="#"><span>Lorem ipsum dolor...</span> </a><div class="separator"></div></div>
So now h2 is not a child of <a> (a{display: block;}). How can I prevent tinyMCE from changing content that I put into it?
Thank you!
Unfortunately, as far as I'm aware - you can't.
TinyMCE 'tidies' the HTML format to make sure its standardised. Maybe check to see if H2 is a 'valid' child element?http://www.w3.org/TR/html401/struct/links.html#h-12.2.2
Hi Alex
You might be looking for this:
http://our.umbraco.org/wiki/how-tos/customizing-the-wysiwyg-rich-text-editor-(tinymce)/allow-any-markup-in-the-tinymce-editor
I don't think you can validate the h2 tag as a child of a though, but can't remember precisely, it just looks wrong
Thank you for replies guys!
Try putting your anchor tag inside the header tag.
<divid="offers"> <h2><aclass="offerItem"href="#">Lorem Ipsum1 <span>Lorem ipsum dolor...</span></a> </h2> <divclass="separator"></div>...
is working on a reply...
Write your reply to:
Upload image
Image will be uploaded when post is submitted
TinyMCE Editor modifies HTML Code when saving
Hello, Im currently in Umbraco v 4.7 running on IIS 7
TinyMCE editor modifies html data when saving. How can I avoid that?
For example, I have html code:
When I update this content int the editor it changes my html to:
So now h2 is not a child of <a> (a{display: block;}). How can I prevent tinyMCE from changing content that I put into it?
Thank you!
Unfortunately, as far as I'm aware - you can't.
TinyMCE 'tidies' the HTML format to make sure its standardised. Maybe check to see if H2 is a 'valid' child element?
http://www.w3.org/TR/html401/struct/links.html#h-12.2.2
Hi Alex
You might be looking for this:
http://our.umbraco.org/wiki/how-tos/customizing-the-wysiwyg-rich-text-editor-(tinymce)/allow-any-markup-in-the-tinymce-editor
I don't think you can validate the h2 tag as a child of a though, but can't remember precisely, it just looks wrong
Thank you for replies guys!
Try putting your anchor tag inside the header tag.
is working on a reply...