Skip to content

fix: detect inline HTML comments in remark-lint-no-html-comments#85

Merged
jiangy10 merged 1 commit into
mainfrom
claude/issue-84-20260512-1725
May 12, 2026
Merged

fix: detect inline HTML comments in remark-lint-no-html-comments#85
jiangy10 merged 1 commit into
mainfrom
claude/issue-84-20260512-1725

Conversation

@jiangy10
Copy link
Copy Markdown
Contributor

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-comments where 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 --> text are caught regardless of how remark parses the surrounding content.

JIRA

DEVSITE-2401

Issue

Closes #84

Test Code

github-action-test
image

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>
@jiangy10 jiangy10 requested a review from louisachu May 12, 2026 21:12
@jiangy10 jiangy10 merged commit e3fa4f4 into main May 12, 2026
3 checks passed
@jiangy10 jiangy10 deleted the claude/issue-84-20260512-1725 branch May 12, 2026 22:06
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.

Linter: detect inline illegal comment usage

2 participants