Skip to content

Conversation

@kivikakk
Copy link
Owner

@kivikakk kivikakk commented Nov 3, 2025

This gets rid of the last input feed oddity. The reference implementation forces every parsed line to end in a newline, even if the last line does not. This is not for spec reasons; a line can be ended by the end of file:

A line is a sequence of zero or more characters other than line feed (U+000A) or carriage return (U+000D), followed by a line ending or by the end of file.

This PR adjusts the parser to be capable of dealing with end-of-input instead of assuming a newline will always be present. There's also a fair bit of "actually deal with CR or CRLF instead of assuming it's always LF" added.

@github-actions
Copy link
Contributor

github-actions bot commented Nov 3, 2025

Command Mean [ms] Min [ms] Max [ms] Relative
./bench.sh ./comrak-2e2e657 94.9 ± 2.7 92.5 106.7 1.72 ± 0.08
./bench.sh ./comrak-main 94.8 ± 0.9 92.5 96.4 1.72 ± 0.06
./bench.sh ./pulldown-cmark 55.2 ± 2.0 53.8 68.5 1.00
./bench.sh ./cmark-gfm 83.4 ± 4.7 77.1 95.9 1.51 ± 0.10
./bench.sh ./markdown-it 215.8 ± 3.1 211.9 227.3 3.91 ± 0.15

Run on Mon Nov 3 04:08:48 UTC 2025

@kivikakk kivikakk force-pushed the push-txtvvkrsnxqk branch 2 times, most recently from 748827f to 6c1584b Compare November 4, 2025 07:27
@kivikakk
Copy link
Owner Author

kivikakk commented Nov 8, 2025

Extensively fuzzed, manually checked, tested against gitlab-glfm-markdown, all OK.

@kivikakk kivikakk merged commit a1fc199 into main Nov 8, 2025
44 checks passed
@kivikakk kivikakk deleted the push-txtvvkrsnxqk branch November 8, 2025 11:01
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