-
Notifications
You must be signed in to change notification settings - Fork 0
Fix unstable syntax in HTML parser #169
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
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -27,10 +27,12 @@ | |
| } | ||
|
|
||
| /// Rewrite a file in place with wrapped tables. | ||
| /// | ||
| /// # Errors | ||
| /// Returns an error if reading or writing the file fails. | ||
| pub fn rewrite(path: &Path) -> std::io::Result<()> { rewrite_with(path, process_stream) } | ||
| pub fn rewrite(path: &Path) -> std::io::Result<()> { | ||
| rewrite_with(path, process_stream) | ||
| } | ||
|
|
||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. issue (review_instructions): The module is missing a Please add a Review instructions:Path patterns: Instructions: |
||
| /// Rewrite a file in place without wrapping text. | ||
| /// | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -13,7 +13,8 @@ | |
| /// Re-export this so callers of [`crate::textproc`] can implement custom | ||
| /// transformations without depending on internal modules. | ||
| pub use tokenize::Token; | ||
| /// Tokenize a block of Markdown while preserving fence context. | ||
| /// Convenience re-export of [`tokenize::tokenize_markdown`]. | ||
| #[doc(inline)] | ||
| pub use tokenize::tokenize_markdown; | ||
|
|
||
| static FENCE_RE: std::sync::LazyLock<Regex> = | ||
|
|
@@ -49,14 +50,20 @@ | |
| is_bq: bool, | ||
| build_prefix: fn(&Captures) -> String, | ||
| rest_group: usize, | ||
| } | ||
|
|
||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. issue (review_instructions): The module is missing a Please add a Review instructions:Path patterns: Instructions: |
||
| impl PrefixHandler { | ||
| fn build_bullet_prefix(cap: &Captures) -> String { cap[1].to_string() } | ||
| fn build_bullet_prefix(cap: &Captures) -> String { | ||
| cap[1].to_string() | ||
| } | ||
|
|
||
| fn build_footnote_prefix(cap: &Captures) -> String { format!("{}{}", &cap[1], &cap[2]) } | ||
| fn build_footnote_prefix(cap: &Captures) -> String { | ||
| format!("{}{}", &cap[1], &cap[2]) | ||
| } | ||
|
|
||
| fn build_blockquote_prefix(cap: &Captures) -> String { cap[1].to_string() } | ||
| fn build_blockquote_prefix(cap: &Captures) -> String { | ||
| cap[1].to_string() | ||
| } | ||
| } | ||
|
|
||
| static HANDLERS: &[PrefixHandler] = &[ | ||
|
|
@@ -186,10 +193,12 @@ | |
| lines.push(trimmed.to_string()); | ||
| } | ||
| lines | ||
| } | ||
|
|
||
| #[doc(hidden)] | ||
| pub fn is_fence(line: &str) -> bool { FENCE_RE.is_match(line) } | ||
| pub fn is_fence(line: &str) -> bool { | ||
| FENCE_RE.is_match(line) | ||
| } | ||
|
|
||
| pub(crate) fn is_markdownlint_directive(line: &str) -> bool { | ||
| MARKDOWNLINT_DIRECTIVE_RE.is_match(line) | ||
|
|
||
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.
issue (review_instructions): The module is missing a
//!module-level comment at the top.Please add a
//!comment at the very top of the file to describe the module's purpose, as required by the review instructions.Review instructions:
Path patterns:
**/*.rsInstructions:
Every module must begin with a
//!comment.