Navigation Menu

Skip to content

Instantly share code, notes, and snippets.

@adelura
Last active August 29, 2015 14:17
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save adelura/50749f9c3b32e88c7bb1 to your computer and use it in GitHub Desktop.
Save adelura/50749f9c3b32e88c7bb1 to your computer and use it in GitHub Desktop.

This gist is a note for ticket:12729.

According to: http://www.w3.org/TR/html401/struct/links.html#h-12.2.2

Steps to reproduce:

  1. Set HTML with following selection:
<ul>
    <li><a href="#one">one</a></li>
    <li><a href="#two">^two</a></li>
</ul>
  1. Press backspace key.

Actual result:

<ul>
    <li><a href="#one">one<a href="#two">two</a></a></li>
</ul>

Above produced nested anchors, which is not desirable.

Expected result:

<ul>
    <li><a href="#one">one</a><a href="#two">two</a></li>
</ul>

But what about this situation in general, can we do the same?

From:

<ol>
	<li>1<ol><li>1.1</li></ol></li>
	<li>^2</li>
</ol>

To (after fix):

<ol>
	<li>1<ol><li>1.1</li></ol>2</li>
</ol>

Or (before fix):

<ol>
	<li>1<ol><li>1.12</li></ol></li>
</ol>
@fredck
Copy link

fredck commented Mar 20, 2015

No, we don't want to handle text after nested list items. So the expected behaviour of your last example is:

<ol>
    <li>1<ol><li>1.12</li></ol></li>
</ol>

@adelura
Copy link
Author

adelura commented Mar 20, 2015

Another case to care of:
Before

<ol>
    <li>1<ol><li>1.1</li></ol>foo</li>
    <li>^2</li>
</ol>

After:

<ol>
    <li>1<ol><li>1.1</li></ol>foo2</li>
</ol>

@adelura
Copy link
Author

adelura commented Mar 20, 2015

<ol>
    <li>
        1
        <ol>
            <li>
                <p>1.1</p>
            </li>
        </ol>
    </li>
    <li>2</li>
</ol>
<ol>
    <li>
        1
        <ol>
            <li>
                <p>1.12</p>
            </li>
        </ol>
    </li>
</ol>

@Reinmar
Copy link

Reinmar commented Mar 24, 2015

You focused on block structures, while the actual issue in #12729 is that content of the second block is inserted into inline elements in the first block.

In the following case:

<ul>
    <li><b>xxx</b></li>
    <li><em>^yyy</em></li>
</ul>

We should get (and other block merging algorithms work this way):

<ul>
    <li><b>xxx</b><em>^yyy</em></li>
</ul>

Not (this is the current result):

<ul>
    <li><b>xxx<em>^yyy</em></b></li>
</ul>

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment