-
-
Notifications
You must be signed in to change notification settings - Fork 482
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
feat(markdown/parser): support thematic break block parser #3982
Conversation
CodSpeed Performance ReportMerging #3982 will degrade performances by 6.85%Comparing Summary
Benchmarks breakdown
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I have a couple of implementation questions.
crates/biome_markdown_parser/tests/md_test_suite/ok/thematic_break_block.md.snap
Outdated
Show resolved
Hide resolved
crates/biome_markdown_parser/src/syntax/thematic_break_block.rs
Outdated
Show resolved
Hide resolved
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The rename of the nodes should be done in a separate PR, because it changes a lot of stuff and even though it's all codegen, it makes the review harder because we can't understand where are the new nodes.
I think I have modified most of the problems. I wrote it again. Could you please help me see it again? thank you @ematipico @dyc3 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There are few things to address, yet. Also, could you please address this comment? https://github.com/biomejs/biome/pull/3982/files#r1766848010
@@ -15,19 +19,54 @@ pub(crate) fn parse_block_list(p: &mut MarkdownParser) { | |||
while !p.at(T![EOF]) { | |||
parse_any_block(p); | |||
} | |||
m.complete(p, MARKDOWN_BLOCK_LIST); | |||
m.complete(p, MD_BLOCK_LIST); | |||
} | |||
|
|||
pub(crate) fn parse_any_block(p: &mut MarkdownParser) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Parsing functions should always return a ParsedSyntax
. Not returning a ParsedSyntax
is considered a side effect, which we want to avoid
Sorry for the rename change in this pr. This is because this is the first concrete implementation of the lexer to the parser, so the change is in this pr |
@@ -63,6 +62,30 @@ impl<'source> MarkdownTokenSource<'source> { | |||
} | |||
} | |||
} | |||
|
|||
/// Returns the number of whitespace characters before the current token until the first new line. | |||
/// tab will be counted as 4 spaces |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is there a link to the spec that says that? We need to justify certain decisions
Summary
support thematic break block parser
https://spec.commonmark.org/0.31.2/#thematic-breaks
Test Plan
snap test