[wp-trac] [WordPress Trac] #22477: The WYSIWYG editor deletes all empty <span> tags
WordPress Trac
noreply at wordpress.org
Sun Dec 23 20:43:16 UTC 2012
#22477: The WYSIWYG editor deletes all empty <span> tags
--------------------------+--------------------
Reporter: hali6sic6 | Owner:
Type: defect (bug) | Status: new
Priority: normal | Milestone: 3.5.1
Component: TinyMCE | Version: 3.4.2
Severity: major | Resolution:
Keywords: close |
--------------------------+--------------------
Comment (by azaozz):
This is also defined in TinyMCE's Schema class:
http://core.trac.wordpress.org/browser/trunk/wp-includes/js/tinymce/wp-
tinymce-schema.js#L705
Also replacing <i> with <em> and <b> with <strong> is affected by the
schema. In 'html5' they are not replaced:
http://core.trac.wordpress.org/browser/trunk/wp-includes/js/tinymce/wp-
tinymce-schema.js#L694
The elements listed for removal when empty
`'ol,ul,sub,sup,blockquote,span,font,a,table,tbody,tr,strong,em,b,i'` will
not be removed if they have an id or name attribute:
https://github.com/tinymce/tinymce/blob/master/jscripts/tiny_mce/classes/html/DomParser.js#L516
So we have couple of options: edit the "remove when empty" list in the
Schema class and/or extend the DomParser class to not remove these
elements when they have any attribute (both would be good to submit for
merging upstream).
--
Ticket URL: <http://core.trac.wordpress.org/ticket/22477#comment:9>
WordPress Trac <http://core.trac.wordpress.org/>
WordPress blogging software
More information about the wp-trac
mailing list