Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Nested list (<ul>, <ol>) should be child of <li>, not sibling #49

Open
karloku opened this issue Aug 23, 2023 · 1 comment
Open

Nested list (<ul>, <ol>) should be child of <li>, not sibling #49

karloku opened this issue Aug 23, 2023 · 1 comment

Comments

@karloku
Copy link
Contributor

karloku commented Aug 23, 2023

Expected behaviour

Given nested list as below

- Green
  1. Lime
  2. Mint
- Red
  - Garnet
  - Crimson
- Blue

Should be parsed into

<ul>
  <li>
    Green
    <ol>
      <li>Lime</li>
      <li>Mint</li>
    </ol>
  </li>
  <li>
    Red
    <ul>
      <li>Garnet</li>
      <li>Crimson</li>
    </ul>
  </li>
  <li>Blue</li>
</ul>

<ul> and <ol> should be child of <li>

Actual behaviour

<ul> and <ol> were parsed as siblings of <li>

<ul>
  <li>Green</li>
  <ol>
    <li>Lime</li>
    <li>Mint</li>
  </ol>
  <li>Red</li>
  <ul>
    <li>Garnet</li>
    <li>Crimson</li>
  </ul>
  <li>Blue</li>
</ul>

This could cause some problems:

  1. In W3C standards <ul> and <ol> cound only have zero or more <li> as their content. Nesting <ul> and <ol> directly is not correct (would fail validation by The Nu Html Checker).
  2. The official @editorjs/nested-list handles html (NestedList.pasteHandler) in the W3C way, making current result not handleable by the official NestedList component.
@Luzefiru
Copy link

Luzefiru commented Mar 21, 2024

This issue was resolved in #50. Please close this @pavittarx.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants