fix: detect inline HTML comments in remark-lint-no-html-comments#85
Merged
Conversation
The previous AST-based approach (visit(tree, 'html')) only caught block-level HTML comments. Inline comments embedded within paragraph text (e.g. `text <!-- comment --> text`) were silently skipped, allowing deploys to fail with HTTP 400. Switch to line-by-line raw text scanning (same pattern as remark-lint-no-details-html), skipping frontmatter, fenced code blocks, and inline code spans to prevent false positives. Fixes: DEVSITE-2401 Co-authored-by: jiangy10 <jiangy10@users.noreply.github.com>
louisachu
approved these changes
May 12, 2026
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.
Problem
All linter check passed on this commit but the deployment failed
/indesign/uxp/resources/recipes/html-elements/index.md ❌ Error HTTP 400 - preview failed
Solution
Fix false negative in
remark-lint-no-html-commentswhere inline HTML comments embedded within paragraph text were not detected, allowing deploys to fail with HTTP 400.Switch from AST node visiting to raw text scanning so comments like
text <!-- comment --> textare caught regardless of how remark parses the surrounding content.JIRA
DEVSITE-2401
Issue
Closes #84
Test Code
github-action-test
