feat: replace external syntax error position manually#223
Merged
Conversation
✅ Deploy Preview for markup-fmt ready!
To edit notification comments on pull requests, go to your Netlify project configuration. |
sergey-kintsel
left a comment
There was a problem hiding this comment.
I ran the new version with the 10MB html file I mentioned before. it worked quite quickly - 1.9 seconds in total, didn't panic.
could we fix the output though? because right now the error message seems to be duplicating itself
syntax error at syntax error at line 199175, col 55: expect token `{`, but found `;`: expect token `{`, but found `;`
5 tasks
Xavrir
added a commit
to Xavrir/deno
that referenced
this pull request
Jun 1, 2026
`deno fmt` did not terminate on large HTML files containing many inline `style="..."` attributes. markup_fmt 0.27.0's `format_style_attr` prepended a whitespace-masked copy of the entire preceding document to every inline style before handing it to the CSS formatter, making formatting O(n^2) in the number of style attributes. markup_fmt 0.27.2 (g-plane/markup_fmt#223) removed that prefix and instead computes source line/column lazily only on error, restoring linear time. Bumping the pin picks up the fix. Closes denoland#30982
Xavrir
added a commit
to Xavrir/deno
that referenced
this pull request
Jun 1, 2026
`deno fmt` did not terminate on large HTML files containing many inline `style="..."` attributes. markup_fmt 0.27.0's `format_style_attr` prepended a whitespace-masked copy of the entire preceding document to every inline style before handing it to the CSS formatter, making formatting O(n^2) in the number of style attributes. markup_fmt 0.27.2 (g-plane/markup_fmt#223) removed that prefix and instead computes source line/column lazily only on error, restoring linear time. Bumping the pin picks up the fix. Adds a fmt spec test that formats an HTML file with many inline style attributes and asserts it completes. Closes denoland#30982
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Advantages
Disadvantages
anyhow::Errorinstead of genericE, but this should be okay because most users will consume the built wasm instead of calling from Rust. Even though, most errors type can be converted toanyhow::Error.Result
Given the code below:
errors will be like:
Close #221
@UnknownPlatypus @sergey-kintsel