Skip to content

fix: detect HTML comments in inline HTML nodes - #140

Closed
Kubudak90 wants to merge 2 commits into
ethereum:masterfrom
Kubudak90:fix-html-inline-comments
Closed

fix: detect HTML comments in inline HTML nodes#140
Kubudak90 wants to merge 2 commits into
ethereum:masterfrom
Kubudak90:fix-html-inline-comments

Conversation

@Kubudak90

Copy link
Copy Markdown

The HtmlComments lint only checked NodeValue::HtmlBlock but not NodeValue::HtmlInline. This meant inline HTML comments were not detected while block comments were correctly flagged.

This PR adds handling for NodeValue::HtmlInline to ensure all HTML comments are detected regardless of their context.

Changes: Added one line to handle NodeValue::HtmlInline in the match statement

All existing tests pass with this change.

Kubudak90 added 2 commits April 7, 2026 16:16
The HtmlComments lint only checked NodeValue::HtmlBlock but not
NodeValue::HtmlInline. This meant inline HTML comments like:

  text <!-- comment --> more text

were not detected, while block comments like:

  <!-- comment -->

were correctly flagged.

This fix adds handling for NodeValue::HtmlInline to ensure all
HTML comments are detected regardless of their context.
Add explicit '_ lifetime annotations to the span_utf8 function in the
LevelExt trait and its implementation. This fixes Rust compiler warnings
about elided lifetimes having multiple possible interpretations.
@Kubudak90

Copy link
Copy Markdown
Author

Closing as duplicate of #141, which includes the same fix plus regression tests.

@Kubudak90 Kubudak90 closed this Apr 13, 2026
Kubudak90 pushed a commit to Kubudak90/eipw that referenced this pull request Apr 20, 2026
The HtmlComments lint previously only checked NodeValue::HtmlBlock,
missing HTML comments embedded within inline HTML like:

  This is the <!-- motivation -->.

Now also checks NodeValue::HtmlInline so inline HTML comments are
correctly flagged. Fixes ethereum#140.
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.

1 participant