Open
Conversation
Author
|
Actually, this branch set end columns more accurately than commonmark/commonmark.js#269 for corner cases. I will update |
Author
|
|
Member
|
Excellent! What errors is |
Author
|
Sorry, I forget to |
We must not remove link reference definitions until we check for list tightness. This commit defers resolving of link reference definitions until finalization of the document. We still need to eagerly remove link reference definitions in setext headings to determine whether it is a setext heading or a thematic break. So this commit provides slightly different functions for resolving link reference definitions and checking if a line is blank for `cmark_strbuf` and `cmark_chunk`.
This flag was introduced by commonmark#284, but we will not need it once we update `S_ends_with_blank_line` to not use resursion in the next commit.
- Set the end position precisely - Check list tightness by comparing line numbers - Remove `LAST_LINE_BLANK` flag See also commonmark/commonmark.js#269 . Classification of end positions: - The end of the current line: - Thematic breaks - ATX headings - Setext headings - Fenced code blocks closed explicitly - HTML blocks (`pre`, comments, and others) - The end of the previous line: - Fenced code blocks closed by the end of the parent or EOF - HTML blocks (`div` and others) - HTML blocks closed by the end of the parent or EOF - Paragraphs - Block quotes - Empty list items - The end position of the last child: - Non-empty list items - Lists - The end position of the last non-blank line: - Indented code blocks The first two cases are handed by `finalize` and `closed_explicitly` flag. Non empty list items and lists are handled in `switch` statements in `finalize`. Indented code blocks are handled by setting the end position every time non-blank line is added to the block.
34997d4 to
ff0d224
Compare
Author
|
I have fixed the leak and the CI is now all green. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This is a port of commonmark/commonmark.js#269.
LAST_LINE_BLANKandLAST_LINE_CHECKEDflags.Comments for each commits (feel free to squash them):
Defer resolution of link reference definitions:
We must not remove link reference definitions until we check for list tightness.
This commit defers resolving of link reference definitions until finalization of the document. We still need to eagerly remove link reference definitions in setext headings to determine whether it is a setext heading or a thematic break.
So this commit provides slightly different functions for resolving link reference definitions and checking if a line is blank for
cmark_strbufandcmark_chunk.Remove
CMARK_NODE__LAST_LINE_CHECKEDflag:This flag was introduced by Parsing ‘* * * * * * … a’ takes quadratic time #284, but we will not need it once we update
S_ends_with_blank_lineto not use resursion in the next commit.Fix list tightness:
This commit changes list tightness checking algorithm from one based on
LAST_LINE_BLANKflag to one based on line numbers. This commit also set the end position precisely.Classification of end positions:
The end of the current line:
pre, comments, and others)The end of the previous line:
divand others)The end position of the last child:
The end position of the last non-blank line:
The first two cases are handed by
finalizeandclosed_explicitlyflag.Non empty list items and lists are handled in
switchstatements infinalize.Indented code blocks are handled by setting the end position every time non-blank line is added to the block.
Benchmark:
masterbranch:mean = 0.1560, median = 0.1550, stdev = 0.0070
this branch:
mean = 0.1610, median = 0.1600, stdev = 0.0032