Make WordPress Core

Opened 15 years ago

Closed 15 years ago

Last modified 15 years ago

#19632 closed defect (bug) (duplicate)

TinyMCE producing invalid nested list markup

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

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)

#1 @knutsp
15 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.

#2 @SergeyBiryukov
15 years ago

Seems like a duplicate of #18261 and #18312?

#3 @szotsaki
15 years ago

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

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

#4 @SergeyBiryukov
15 years ago

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