Skip to content

fix: #870 list parse error - #964

Merged
fxha merged 4 commits into
developfrom
list-parse-issue
Apr 27, 2019
Merged

fxha merged 4 commits into
developfrom
list-parse-issue

Conversation

@Jocs

@Jocs Jocs commented Apr 21, 2019

Copy link
Copy Markdown
Member
Q A
Bug fix? yes
Fixed tickets #870
License MIT

Description

Because we distinguish between task list and bullet list in Mark Text, the parsing here is somewhat different from the commonmark Spec, and the task list needs to be a separate list.

@Jocs
Jocs requested a review from fxha April 21, 2019 11:33
Comment thread src/muya/lib/parser/marked/lexer.js Resolved
Comment thread src/muya/lib/parser/marked/lexer.js Resolved
Comment thread src/muya/lib/parser/marked/lexer.js Resolved
Comment thread src/muya/lib/parser/marked/lexer.js Resolved
@Jocs
Jocs requested a review from fxha April 23, 2019 15:55
@fxha

fxha commented Apr 25, 2019

Copy link
Copy Markdown
Contributor

Regression because new lines get added between lists:

mt_tasklistnewline

@Jocs

Jocs commented Apr 26, 2019

Copy link
Copy Markdown
Member Author

Regression because new lines get added between lists:

Since the task list and the bullet list have been distinguished, they are two lists, so a blank line should be inserted between them.

@fxha

fxha commented Apr 26, 2019

Copy link
Copy Markdown
Contributor

Since the task list and the bullet list have been distinguished, they are two lists, so a blank line should be inserted between them.

The problem with this is that it's against CommonMark and GFM when saving the document wrong. It's fine that we distinguish between bullet and task list in preview mode but when saving we should be compatible to markdown specification. We can fix this like CommonMark 0.28 264 helper in exportMarkdown.js. However there are issues with loose lists.

@Jocs

Jocs commented Apr 26, 2019

Copy link
Copy Markdown
Member Author

We can fix this like CommonMark 0.28 264 helper in exportMarkdown.js. However there are issues with loose lists.

When we output markdown, unless the user chooses to beautify the markdown, we should restore the state of the markdown entered by the user. This is a basic principle.

But now the problem is, we don't know, is there a blank line between the bullet list and task list in the original markdown?

@fxha fxha left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Let us fix the remaining issues in #983. I don't really know how to fix this in a good way.

@fxha
fxha merged commit 372fe02 into develop Apr 27, 2019
@fxha
fxha deleted the list-parse-issue branch April 27, 2019 15:16
Jocs added a commit that referenced this pull request Aug 7, 2019
* fix: #870 list parse error

* remove semiclon

* add more comments

* rename isTaskListItem to isTaskList
thimbleberrysystems pushed a commit to thimbleberrysystems/WordBird that referenced this pull request Jun 21, 2026
* fix: marktext#870 list parse error

* remove semiclon

* add more comments

* rename isTaskListItem to isTaskList
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

Successfully merging this pull request may close these issues.

2 participants