Skip to content

Conversation

@fraxken
Copy link
Member

@fraxken fraxken commented Apr 2, 2023

Add a new option removeHTMLComments to remove any HTML comment from the provided source (or file).

Adding this as an option disabled by default because I'm not quite sure of the impact of this (and if this could be exploited in someway).

Should fixes #109

@fraxken fraxken requested a review from a team April 2, 2023 17:24
}

export function removeHTMLComment(str) {
return str.replace(/<!--[\s\S]*?(?:-->)/g, "");

Check failure

Code scanning / CodeQL

Incomplete multi-character sanitization

This string may still contain [<!--](1), which may cause an HTML element injection vulnerability.
Copy link
Member

@tony-go tony-go left a comment

Choose a reason for hiding this comment

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

LGTM % a bit of doc

@fraxken fraxken merged commit 1af1621 into master Apr 5, 2023
@PierreDemailly PierreDemailly deleted the html-comment branch April 5, 2023 19:05
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.

HTML Comment Parsing Error

4 participants