Skip to content

Remove dead S_advance_offset call on closing code fences - #631

Open
cpruijsen wants to merge 1 commit into
commonmark:masterfrom
cpruijsen:fix/issue-590-remove
Open

cpruijsen wants to merge 1 commit into
commonmark:masterfrom
cpruijsen:fix/issue-590-remove

Conversation

@cpruijsen

Copy link
Copy Markdown

Per @nwellnhof in #590: the call is dead, so removing it rather than correcting the arithmetic.

The offset it computes is never read — finalize takes end_column from curline.size or last_line_length, and the caller goes straight to the end of the line, which uses input.len.

No behaviour change. All tests pass.

Closes #590

The call advanced parser->offset from its current position rather than
from parser->first_nonspace, so the resulting offset was wrong for an
indented or nested closing fence. The value is never read: finalize
takes end_column from parser->curline.size or parser->last_line_length,
and the caller goes straight to the end of the line, which uses
input.len. Remove the call rather than correct the arithmetic.

Closes commonmark#590
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.

Incorrect parser->offset advancement for closing fenced code blocks in parse_code_block_prefix

1 participant