Skip to content

fix: detect inline HTML comments in markdown-html-comments lint - #141

Open
Kubudak90 wants to merge 1 commit into
ethereum:masterfrom
Kubudak90:fix-inline-html-comments
Open

fix: detect inline HTML comments in markdown-html-comments lint#141
Kubudak90 wants to merge 1 commit into
ethereum:masterfrom
Kubudak90:fix-inline-html-comments

Conversation

@Kubudak90

Copy link
Copy Markdown

Fixes #119

Problem

The markdown-html-comments lint was only checking for NodeValue::HtmlBlock but not NodeValue::HtmlInline. This meant that inline HTML comments like:

text <!-- inline comment --> more text

were not being detected and reported, while block-level HTML comments were.

Solution

Added support for inline HTML comments by also checking NodeValue::HtmlInline in addition to NodeValue::HtmlBlock.

Changes

  • Modified html_comments.rs to handle both HtmlBlock and HtmlInline node types
  • Added 2 new test cases:
    • inline_html_comment_error: Tests that inline comments are detected as errors
    • inline_html_comment_warn: Tests that inline comments are detected as warnings when status is in warn_for list

Testing

All 4 tests pass:

  • warn (existing)
  • error (existing)
  • inline_html_comment_error (new)
  • inline_html_comment_warn (new)

The lint was only checking for NodeValue::HtmlBlock but not
NodeValue::HtmlInline, meaning inline HTML comments like:

  text <!-- comment --> more text

were not being detected and reported.

This change adds support for inline HTML comments by also checking
NodeValue::HtmlInline in addition to NodeValue::HtmlBlock.

Fixes ethereum#119
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.

markdown-html-comments not reporting an error in Review

1 participant