[wp-trac] [WordPress Trac] #28191: Visual Editor Changing Order of Outputted HTML Tags
WordPress Trac
noreply at wordpress.org
Fri May 9 10:54:54 UTC 2014
#28191: Visual Editor Changing Order of Outputted HTML Tags
--------------------------+-----------------------------
Reporter: EMG | Owner:
Type: defect (bug) | Status: new
Priority: normal | Milestone: Awaiting Review
Component: Editor | Version: 3.9.1
Severity: normal | Keywords:
Focuses: |
--------------------------+-----------------------------
This ticket is coming about in relation to this support thread here:
http://wordpress.org/support/topic/title-showing-before-href
And -possibly- might be indirectly related to an old closed ticket #5796.
Unlike previous tickets that mention tags gone missing (though this ticket
might also be related), this ticket is in regards to the output order of
tags being changed when swapping to the Visual Editor from the Text Editor
and then swapping back to the Text Editor.
Included are two examples tested on both the thread posters' installs
running 3.9 and on my own vanilla install running 3.9.1:
'''Example 1:'''
`<a href="http://wordpress.org" title="WordPress dot org">WordPress!</a>`
typed up in the Text Editor gets outputted into:
`<a title="WordPress dot org" href="http://wordpress.org">WordPress!</a>`
when swapping to Visual Editor and then swapping back to Text Editor.
'''Example 2:'''
`<iframe width="560" height="315"
src="//www.youtube.com/embed/embedcodehere" frameborder="0"
allowfullscreen></iframe>`
typed (or pasted directly from YT, also notice YT's missing/incomplete
additional `allowfullscreen` declaration) into Text Editor gets outputted
to:
`<iframe src="//www.youtube.com/embed/embedcodehere" width="560"
height="315" frameborder="0" allowfullscreen="allowfullscreen"></iframe>`
when swapping to Visual Editor and then swapping back to Text Editor (also
notice the 'completed' `allowfullscreen` declaration).
'''Some Clarification:'''
IF one is ONLY using either Text Mode (and ''never'' swaps to Visual
Editor during the time of post/page-writing) or simply has Visual Editor
turned off in preferences, this tag swapping does NOT occur.
This is the expected and 'normal' behavior to my/our understanding - that
properly written links and embeds ought to simply output out as they are
typed.
This 'bug' is only triggered when someone swaps into Visual Editor mode
from Text Editor mode and back into Text Editor mode that this happens.
'''Some Additional Thoughts and Information:'''
Though I myself cannot confirm this because I always keep Visual Editor
off unless helping others to troubleshoot, the OP of the thread I
referenced mentioned that the change is recent. Their 'how I write posts'
behavior and habits haven't changed but the way things are outputting has.
I am unsure as to why this tag order swapping is occurring and initially,
I thought this was/is related to changes in TinyMCE.
Upon some rethinking, I am wondering if this has something to do with
'sanitizing' - how WordPress tries to correct improperly coded code within
posts and pages.
('''Note:''' HTML documentation and SEO documentation don't mention much
about tag orders other than to be consistent with how they are written
with some publications suggesting alphabetizing, but as the samples show,
the outputted tags aren't alphabetized, either!)
Whatever the case is, the OP expressed concern about the sudden swapping
of tag orders for no apparent reason and additionally expressed a desire
to have it back to the way it was (no random tag order swapping around) to
maintain coding consistency (which I agree).
As such, I am submitting this ticket.
Thanks!
--
Ticket URL: <https://core.trac.wordpress.org/ticket/28191>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform
More information about the wp-trac
mailing list