[wp-trac] [WordPress Trac] #48196: The Code Editor generates tag soup with empty paragraphs in td elements
WordPress Trac
noreply at wordpress.org
Wed Oct 2 10:57:52 UTC 2019
#48196: The Code Editor generates tag soup with empty paragraphs in td elements
--------------------------+-----------------------------
Reporter: vinc17 | Owner: (none)
Type: defect (bug) | Status: new
Priority: normal | Milestone: Awaiting Review
Component: Editor | Version: 5.2.3
Severity: normal | Keywords:
Focuses: |
--------------------------+-----------------------------
When using the Code Editor with WordPress 5.2.3, the opening `<p>` and
closing `</p>` tags do not appear in the editor and are automatically
handled by the editor. If I try to add them to fix things, they are
automatically removed. So, now the problem with this automatic handling:
The Code Editor generates tag soup with empty paragraphs in td elements.
For instance, the generated HTML code looks like this:
{{{
<td>text<br />
text</p>
<p>text<br />
text</p>
<p>text</td>
}}}
There are two issues (maybe related). First, this is tag soup. For various
reasons (parsing with XML tools, better HTML code understanding and
maintenance...), the Code Editor should not omit opening and closing tags.
Here, the first `</p>` does not have a matching opening tag and the last
`<p>` does not have a matching closing tag. Moreover, in HTML5 parsing,
the first `</p>` is parsed as if it were `<p></p>`, i.e. an empty
paragraph; and the text before it should really be in a paragraph for
consistency. If the Code Editor thought that the `<td>` implied an opening
`<p>` just after it, it is wrong! In short, the generated code should be:
{{{
<td><p>text<br />
text</p>
<p>text<br />
text</p>
<p>text</p></td>
}}}
--
Ticket URL: <https://core.trac.wordpress.org/ticket/48196>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform
More information about the wp-trac
mailing list