Ticket #14123 (new Bug)

Opened 23 months ago

Last modified 2 months ago

Tinymce strips <a href=".html"> tags around <div></div>

Reported by: fvandijk Owned by:
Priority: minor Milestone: 4.x
Component: Unknown Version: 4.3
Keywords: TinyMCE Cc:

Description

In HTML5 it is valid to have a HTML structure like this:

<a href="bla">
<div>
bla bla
</div>
</a>

But Tinymce strips the <a> tag client side from the source html as this was not a valid construct in HTML4/XHTML

To reproduce: open a wysiwyg text field, switch to the html code screen, paste code like above. Products.TinyMCE 1.3.6 / Plone 4.3.3

Change History

comment:1 Changed 2 months ago by terapyon

You need to add advanced setting on TinyMCE settings.

{"valid_child_elements":"a[span|b|i|u|sup|sub|img|div|#text]"}

If you are using Plone 5, valid_child_elements is not supported. Please use a below.

{"valid_children":"+a[span|b|i|u|sup|sub|img|div|#text]"}
Note: See TracTickets for help on using tickets.