Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix sourcepos, add missing extension tests and add sourcepos tests #223

Open
wants to merge 27 commits into
base: master
Choose a base branch
from
Open
Changes from 1 commit
Commits
Show all changes
27 commits
Select commit Hold shift + click to select a range
937fb16
Add `cmark_strbuf_remove` that removes a subrange of characters.
chriszielinski Apr 26, 2019
0fea1dd
Fix source positions for inlines inside inconsistently indented blocks.
chriszielinski Apr 26, 2019
e523c73
Add three additional source position tests.
chriszielinski Apr 26, 2019
6df4f1f
Fix outdated expected test result.
chriszielinski Apr 26, 2019
891db70
Fix autolink source position.
chriszielinski May 1, 2019
9160d60
Fix expected autolink test fixture, and add an additional autolink so…
chriszielinski May 1, 2019
469031e
Fix source position of setext headings.
chriszielinski May 3, 2019
51cd4f5
Add setext heading test case.
chriszielinski May 3, 2019
4ef6064
Fix source position for ATX-style headings.
chriszielinski May 3, 2019
035c392
Add ATX-style heading source position test case.
chriszielinski May 3, 2019
92444d7
Fix HTMl block source position.
chriszielinski May 6, 2019
2157196
Add HTML block source position test case.
chriszielinski May 6, 2019
79bf93b
Fix thematic break source position.
chriszielinski May 6, 2019
53041c3
Add thematic break source position test case.
chriszielinski May 6, 2019
be7f9c0
Fix ending source position for lists and list items.
chriszielinski May 8, 2019
d2721bf
Add list/list item source position test case.
chriszielinski May 8, 2019
94dba88
Remove commented out code.
chriszielinski May 8, 2019
99621a3
Correct list source position.
chriszielinski May 8, 2019
2570911
Fix source position for HTML blocks without a matching end condition.
chriszielinski May 15, 2019
062d461
Add test case for source position of a HTML block without a matching …
chriszielinski May 15, 2019
a4222f5
Fix line length.
chriszielinski May 15, 2019
538ff21
Fix soourcepos for strikethrough.
martincizek Apr 9, 2020
ce43592
Add test for broken multiline strikethrough. Restore adapted extensio…
martincizek Apr 10, 2020
de09b9c
Add test catching sourcepos bugs related to tables with a paragraph r…
martincizek Apr 10, 2020
27ff048
Fix sourcepos bugs related to table headers with a rejected paragraph.
martincizek Apr 10, 2020
a2792cf
Add sourcepos to softbreak and linebreak nodes if SOURCEPOS requested…
martincizek Apr 11, 2020
80548df
Fix shifted paragraph table offset introduced in ddf21bb.
martincizek May 4, 2021
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Fix ending source position for lists and list items.
  • Loading branch information
chriszielinski authored and martincizek committed May 4, 2021
commit be7f9c0b4068cdee016f9ddd2226c6ffd9a1ebe7
8 changes: 7 additions & 1 deletion src/blocks.c
Original file line number Diff line number Diff line change
@@ -327,7 +327,11 @@ static cmark_node *finalize(cmark_parser *parser, cmark_node *b) {
parser->last_line_length += b->end_column;
}

if (parser->curline.size == 0) {
if ((S_type(b) == CMARK_NODE_ITEM || S_type(b) == CMARK_NODE_LIST)
&& b->last_child) {
b->end_line = b->last_child->end_line;
b->end_column = b->last_child->end_column;
} else if (parser->curline.size == 0) {
// end of input - line number has not been incremented
b->end_line = parser->line_number;
b->end_column = parser->last_line_length;
@@ -1300,6 +1304,8 @@ static void open_new_blocks(cmark_parser *parser, cmark_node **container,
// add the list item
*container = add_child(parser, *container, CMARK_NODE_ITEM,
parser->first_nonspace + 1);
// (*container)->end_line = parser->line_number;
// (*container)->end_column = parser->column;
/* TODO: static */
memcpy(&((*container)->as.list), data, sizeof(*data));
parser->mem->free(data);