Skip to content

Exception when combining two lists with text in between #707

Closed

Description

@fxha

Description

An exception occurs when combining two lists with text in between and you make the text to a list.

  • Can you reproduce the issue?

Steps to reproduce

  1. Template:
- a
- b

<cursor>foo

- c
- d
  1. Write -<space> before foo to create a list

Expected behavior:

The three lists (two lists and the new one) should be combined to a single list.

Actual behavior:

Runtime exception.

Versions

  • Mark Text: v0.13.65
  • Operating system: all

Activity

  1. added
    🐛 bug
    on Mar 1, 2019
  2. Jocs commented on Mar 1, 2019

    @Jocs
    Member

    The three lists (two lists and the new one) should be combined to a single list.

    is it possible to became one loose list and two tight list if you set the prefer list is loose list? Because the first and the last lists are tight list.

  3. fxha commented on Mar 1, 2019

    @fxha
    ContributorAuthor

    That's true. If preferLooseListItem is set to true everything is fine except the lists are not combined until you re-parse the document with markedjs.

  4. Jocs commented on Mar 1, 2019

    @Jocs
    Member

    until you re-parse the document with markedjs.

    will markedjs treat it as one loose list?

  5. fxha commented on Mar 1, 2019

    @fxha
    ContributorAuthor

    Yes, it does. As per CommonMark/GFM the following list is a loose list:

    - a
    - d
    
    - c
    
    - d
    - e
    

    But in this issue it should be a tight list because my default list settings is tight and I want to combine both.

  6. self-assigned this
    on Mar 1, 2019
  7. Jocs commented on Mar 3, 2019

    @Jocs
    Member

    @fxha That's strange, I can not reproduce this issue when I follow you reproduce steps. Can you reproduce this bug?

  8. fxha commented on Mar 3, 2019

    @fxha
    ContributorAuthor

    Yes, you have to set preferLooseListItem to false.

  9. Jocs commented on Mar 4, 2019

    @Jocs
    Member

    It explains the matter. I can reproduce it now.

  10. added 4 commits that reference this issue on Mar 28, 2019
    98b71f5
    671ee45
    9851a70
    90dc3fd
  11. added a commit that references this issue on Mar 29, 2019
    73a4abd
  12. added a commit that references this issue on Feb 20, 2025
    a15d3d0
  13. added a commit that references this issue on Jun 21, 2026
    ee4bac6
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

🐛 bug

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions