Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remainder of entire string is stripped when encountering consecutive block comment tokens #73

Open
rekmarks opened this issue Mar 9, 2022 · 1 comment

Comments

@rekmarks
Copy link

rekmarks commented Mar 9, 2022

In JavaScript / TypeScript, this package will strip not just the block comment but the entire remainder of the string when a block comment of the form /**/ is encountered. For example, the string hello/**/ world will become hello instead of hello world.

This bug only affects block comments of the form /**/. E.g. /***/ and /******/ are unaffected.

@nickcarnival
Copy link

This might not be related, but here's a short reproducible example:

const strip = require("strip-comments");

const data = `
 /**************************
 * Example of some comments 
 ***************************
 *
/

export function test() {
  console.log("This function should remain");
}
`;

console.log(strip(data));

Expected Output:

export function test() {
  console.log("This function should remain");
}

Actual Output:

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

No branches or pull requests

2 participants