Skip to content

fix: ignore issue references inside HTML comments#144

Merged
travi merged 2 commits into
semantic-release:masterfrom
LuisUrrutia:fix/ignore-html-comments
May 1, 2026
Merged

fix: ignore issue references inside HTML comments#144
travi merged 2 commits into
semantic-release:masterfrom
LuisUrrutia:fix/ignore-html-comments

Conversation

@LuisUrrutia
Copy link
Copy Markdown
Contributor

@LuisUrrutia LuisUrrutia commented Dec 16, 2025

Summary

Fixes semantic-release/github#143
Closes #149

  • Fix issue references being detected inside HTML comments (<!-- -->)
  • HTML comments are now filtered out before parsing, similar to code blocks

Solution

Added HTML_COMMENT_REGEXP to strip HTML comments from text before parsing, consistent with existing handling for:

  • Fenced code blocks (```)
  • Inline code (`)
  • <code> tags

Comments are replaced with a space (not removed entirely) to preserve word boundaries between adjacent text.

Changes

  • index.js: Added HTML_COMMENT_REGEXP and filtering step
  • index.js: Renamed noCodeBlockfilteredText for clarity
  • test/index.test.js: Added tests for HTML comment exclusion

Copy link
Copy Markdown
Member

@babblebey babblebey left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This Looks great, thanks @LuisUrrutia

@babblebey babblebey requested a review from travi December 17, 2025 10:11
@LuisUrrutia
Copy link
Copy Markdown
Contributor Author

It’s been a few months since I opened this PR. Sorry to ping you, @travi, but could you take a look when you get a chance?

Copy link
Copy Markdown
Member

@travi travi left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

thanks!

@travi
Copy link
Copy Markdown
Member

travi commented May 1, 2026

sorry for the delay. thanks for reporting and sticking with getting this contribution included

@travi travi merged commit 779423b into semantic-release:master May 1, 2026
9 checks passed
@github-actions
Copy link
Copy Markdown

github-actions Bot commented May 1, 2026

🎉 This PR is included in version 7.0.2 🎉

The release is available on:

Your semantic-release bot 📦🚀

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

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Incorrectly parses commented PR template references

3 participants