Skip to content

fix: update list item lexer and parser - #803

Merged
Jocs merged 2 commits into
marktext:masterfrom
fxha:fix-commonmark-265
Mar 27, 2019
Merged

Jocs merged 2 commits into
marktext:masterfrom
fxha:fix-commonmark-265

Conversation

@fxha

@fxha fxha commented Mar 24, 2019 •

Copy link
Copy Markdown
Contributor
Q A
Bug fix? yes
License MIT

Description

Fixed CommonMark 264 and 265, allow ) as ordered list delimiter and some small list (item) fixes.

Changing the bullet or ordered list delimiter starts a new list:

- foo
- bar
+ baz
1. foo
2. bar
3) baz

No need to update changelog because parser updates are already listed.

@fxha
fxha requested a review from Jocs March 24, 2019 23:17
@fxha fxha changed the title fix: CommonMark 264 [WIP] fix: CommonMark 264 Mar 24, 2019
@fxha
fxha force-pushed the fix-commonmark-265 branch from fa77373 to 57cf22c Compare March 25, 2019 10:59
@fxha fxha changed the title [WIP] fix: CommonMark 264 fix: update list item lexer and parser Mar 25, 2019
Comment thread src/muya/lib/parser/marked/README.md Resolved
Comment thread src/muya/lib/contentState/updateCtrl.js Resolved
@fxha
fxha force-pushed the fix-commonmark-265 branch from 57cf22c to e5975f0 Compare March 25, 2019 15:09
@Jocs

Jocs commented Mar 25, 2019

Copy link
Copy Markdown
Member

A problem:

input

1. foo
2. bar

turn to source code mode

you'll find wrong markdown syntax.

@Jocs

Jocs commented Mar 25, 2019

Copy link
Copy Markdown
Member

Problem 2:

Step one: type 1. foo then Enter. create one order list.

Step two: type 3) bar should create another order list, but it still add to the order list above and combine to one order list.

Comment thread src/muya/lib/parser/marked/lexer.js Resolved
Comment thread src/muya/lib/parser/marked/lexer.js Resolved
@fxha

fxha commented Mar 26, 2019

Copy link
Copy Markdown
Contributor Author

@Jocs Should be fixed.

@Jocs

Jocs commented Mar 27, 2019

Copy link
Copy Markdown
Member

Problem 3:

write markdown:

1) foo
2) bar

change the loose/tight type by menu, it became a loose list in preview mode.

turn into source code mode, it still tight list.

@fxha

fxha commented Mar 27, 2019

Copy link
Copy Markdown
Contributor Author

@Jocs Problem 3 is actually another issue because it can be reproduced with v0.13.65. Please open an issue for this and it seems that the change is not forwarded because when you type e.g. a before changing into source-code mode everything is fine.

@Jocs

Jocs commented Mar 27, 2019

Copy link
Copy Markdown
Member

@fxha I'll open it later.

@Jocs
Jocs merged commit 270d33f into marktext:master Mar 27, 2019
@fxha
fxha deleted the fix-commonmark-265 branch March 27, 2019 11:55
thimbleberrysystems pushed a commit to thimbleberrysystems/WordBird that referenced this pull request Jun 21, 2026
* fix: CommonMark 264

* fix: muya list behavior
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