Skip to content

fix(prost-build): don't escape brackets inside fenced code blocks - #1430

Draft
b-wulan wants to merge 1 commit into
tokio-rs:masterfrom
b-wulan:fix/2026-05-28-no-bracket-escape-in-code-blocks
Draft

fix(prost-build): don't escape brackets inside fenced code blocks#1430
b-wulan wants to merge 1 commit into
tokio-rs:masterfrom
b-wulan:fix/2026-05-28-no-bracket-escape-in-code-blocks

Conversation

@b-wulan

@b-wulan b-wulan commented May 28, 2026

Copy link
Copy Markdown

sanitize_line was escaping [ and ] on every comment line, including lines inside fenced code blocks — so vec![1] became vec!\[1\] in generated rustdoc (fixes #683).

The fix tracks whether each line falls between a pair of ```/~~~ fence delimiters and skips bracket escaping inside them. All existing tests still pass; a new test covers the reported case.

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.

square brackets are wrongly escaped in code blocks

1 participant