#6376 closed enhancement (duplicate)
Visual Editor creates invalid Definition Lists
| Reported by: |
|
Owned by: | |
|---|---|---|---|
| Milestone: | Priority: | low | |
| Severity: | normal | Version: | 2.5 |
| Component: | General | Keywords: | |
| Focuses: | Cc: |
Description
Creating a post in the plain code editor which includes definition lists is easy enough. However, opening them in the visual editor causes WordPress to strip out any <p> tags, creating invalid markup.
What I had coded in the Code editor was something like this, which is perfectly valid:
====
<dl>
<dt>term</dt>
<dd><p>paragraph</p>
<p>paragraph2</p></dd>
</dl>
====
However, the visual editor converts that nice markup to this:
====
<dl> <dt>term</dt> <dd>paragraph
paragraph2</dd> </dl>
====
When output by WordPress, there is no <p> tag placed between <dd> and "paragraph"; however, the "paragraph" does receive a </p> tag, which is not balanced.
Don't know if the same problems occur with ordered and unordered lists, but this definitely should be fixed.
TinyMCE doesn't use <dl><dt><dd> lists, although it understands them. However wpautop() doesn't. Plain definition lists work well, but if you need to use paragraphs whitin definition lists, don't switch to the visual editor, so they don't get stripped. This works as expected: