WordPress.org

Make WordPress Core

Opened 2 years ago

Closed 2 years ago

Last modified 2 years ago

#19632 closed defect (bug) (duplicate)

TinyMCE producing invalid nested list markup

Reported by: szotsaki Owned by:
Milestone: Priority: normal
Severity: normal Version: 3.3
Component: Formatting Keywords:
Focuses: Cc:

Description

Edit a post either in HTML or in TinyMCE, WP will scramble the <ul> and <li> formatting.

1.) create a list with an item
2.) use indentation (first with the TMCE buttons, then in HTML)
3.) save and debug

Example:

<ul>
    <li>…</li>
    <li>…</li>
    <ul>
        <li>…</li>
        <ul>
            <li>…</li>
            <li>…</li>
            <li>…</li>
        </ul>
        <li>…</li>
    </ul>
</ul>

The result is:

<ul>
    <li />
    <li />
</ul>
<ul>
    <li />
</ul>
<ul>
    <li />
    <li />
    <li />
</ul>
<li />

The only option would be to correct this in database… but somehow I'm not able to do that, because somehow it's still wrong.

Change History (4)

comment:1 knutsp2 years ago

  • Cc knut@… added

In Settings - Writing there is an option to correct invalidly nested markup in XHTML. I can verify the problem as long as this option is on. No problem when this option is turned off.

I have learned that (jn XHTML) all list elements should be li elements, including nested lists itself. TinyMCE makes the nested list a just an ul element, missing the surrounding li. WordPress seems to detect illegal nesting and tries to correct it. The result is a broken nested list.

I tried creating a correctly nested list in the HTML editor, with the "correct invalidly nested XHTML automatically" option on. No problem.

I suggest changing the ticket description to address either TinyMCE producing invalid nested list markup or the "correct invalidly nested XHTML automatically" function.

comment:2 SergeyBiryukov2 years ago

Seems like a duplicate of #18261 and #18312?

comment:3 szotsaki2 years ago

  • Resolution set to duplicate
  • Status changed from new to closed
  • Summary changed from It's impossible to use list indentation in WordPress to TinyMCE producing invalid nested list markup

Yes, this is a duplicate of #18261. Also modified the ticket description.

comment:4 SergeyBiryukov2 years ago

  • Milestone Awaiting Review deleted
Note: See TracTickets for help on using tickets.