Skip to content

Fix nested lists rendering#1181

Merged
SergioEstevao merged 14 commits intodevelopfrom
issue/1180_nested_list_fix_rendering
May 23, 2019
Merged

Fix nested lists rendering#1181
SergioEstevao merged 14 commits intodevelopfrom
issue/1180_nested_list_fix_rendering

Conversation

@SergioEstevao
Copy link
Copy Markdown
Contributor

Fixes #1180

This PR addresses the issues reported on the ticket above by creating a dedicated LIConverter in order to check when to add a intrinsic representation for the

  • before or after the children.

    The main logic here is that if the Li element has children elements that are nested lists and no text defined we need to add "\n" to the content in order for the marker to be shown.

    To test:

    • If you set the HTML like this:
    <ul>
      <li>One</li>
      <li>
        <ul>
          <li>Two</li>
        </ul>
      </li>
    </ul>
    

    You should get something like this rendered:

    Screenshot 2019-05-01 at 12 27 52

    Besides this test the remaining logic of lists should be retested:

    • Create lists
    • Indent element
    • Change styles
    • Remove list item
    • Add new list item
  • This converter beside doing the regular attribute setting for li element it also check if there is children nodes to decide if a implicit representation is needed.
    @SergioEstevao SergioEstevao added this to the 1.6.2 milestone May 2, 2019
    Copy link
    Copy Markdown
    Contributor

    @etoledom etoledom left a comment

    Choose a reason for hiding this comment

    The reason will be displayed to describe this comment to others. Learn more.

    Hey @SergioEstevao !
    I tested with the same snippet you shared and I keep getting the same result as shown in the issue:

    lists

    I tried cleaning the project's build folder and nuking DerivedData. And I do see the test passing locally, so I'm not sure what's happening.
    Let me know if it works on your side and I'll check again, maybe I'm doing something wrong? 🤔

    @SergioEstevao
    Copy link
    Copy Markdown
    Contributor Author

    @etoledom Thanks for the check! I fixed the issue can you check it again?

    @etoledom etoledom self-requested a review May 7, 2019 13:27
    Copy link
    Copy Markdown
    Contributor

    @etoledom etoledom left a comment

    Choose a reason for hiding this comment

    The reason will be displayed to describe this comment to others. Learn more.

    Now it's working great 🎉

    @etoledom
    Copy link
    Copy Markdown
    Contributor

    Hey @SergioEstevao - I did a second pass to this PR after all the new commits, and I did find one issue:

    After pressing enter to scape the list and coming back again, when I try to press double enter to scape the list again, the bullet stays with the cursor:

    Lists

    I noticed that this also happens on develop branch, so it shouldn't be a blocker to merge this PR ✅

    @SergioEstevao SergioEstevao merged commit a1ad1a9 into develop May 23, 2019
    @SergioEstevao SergioEstevao deleted the issue/1180_nested_list_fix_rendering branch May 23, 2019 10:32
    Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

    Projects

    None yet

    Development

    Successfully merging this pull request may close these issues.

    Nested lists are not rendered properly

    2 participants