Make WordPress Core

Opened 10 years ago

Closed 10 years ago

Last modified 9 years ago

#6376 closed enhancement (duplicate)

Visual Editor creates invalid Definition Lists

Reported by: fool4christ Owned by:
Milestone: Priority: low
Severity: normal Version: 2.5
Component: General Keywords:
Focuses: Cc:


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.

Change History (3)

#1 @azaozz
10 years ago

  • Component changed from TinyMCE to General
  • Milestone changed from 2.5 to 2.6
  • Priority changed from high to low
  • Type changed from defect to enhancement

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:


#2 @azaozz
10 years ago

  • Milestone 2.6 deleted
  • Resolution set to duplicate
  • Status changed from new to closed

Duplicate of #6041

Note: See TracTickets for help on using tickets.