Skip to content

fix(html): skip HTML balance warnings when Handlebars is present#3098

Open
leno23 wants to merge 1 commit into
rust-lang:masterfrom
leno23:fix/suppress-html-warnings-handlebars-2941
Open

fix(html): skip HTML balance warnings when Handlebars is present#3098
leno23 wants to merge 1 commit into
rust-lang:masterfrom
leno23:fix/suppress-html-warnings-handlebars-2941

Conversation

@leno23
Copy link
Copy Markdown

@leno23 leno23 commented May 17, 2026

Summary

  • Suppress unclosed/unexpected HTML tag warnings while parsing inline HTML that contains Handlebars syntax ({{...}}).
  • Handlebars helpers such as {{#include}} are expanded after the HTML tree is built; validating tag balance on the pre-expansion source produced false positives (e.g. <details> wrapping an include inside an admonition).

Fixes #2941.

Test plan

  • cargo test -p mdbook html_with_handlebars
  • Existing unclosed_html_tags test still passes (real unclosed tags still warn)

Made with Cursor

Handlebars helpers such as `{{#include}}` are expanded after the HTML
tree is built. Validating tag balance on the pre-expansion source caused
false positives for patterns like `<details>...{{#include ...}}</details>`
inside admonitions.

Fixes rust-lang#2941.

Co-authored-by: Cursor <cursoragent@cursor.com>
@leno23 leno23 force-pushed the fix/suppress-html-warnings-handlebars-2941 branch from bc32cee to f81ce12 Compare May 17, 2026 02:13
@ehuss
Copy link
Copy Markdown
Contributor

ehuss commented May 19, 2026

@leno23 I see that you've opened a large number of PRs using an AI tool. Please do not do that. Per the contributing guide, we are unable to review these.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

S-waiting-on-review Status: waiting on a review

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Warnings when using an include within an admonition

3 participants