rouge-ruby / rouge

A pure Ruby code highlighter that is compatible with Pygments
https://rouge.jneen.net/
Other
3.32k stars 731 forks source link

Bug in JavaScript lexer #1834

Closed legacy3 closed 2 years ago

legacy3 commented 2 years ago

Name of the lexer The JavaScript Lexer.

Code sample A sample of the code that produces the bug.

  // Format return
  let ret = "";

  ret += `// ${action.Name ?? "Unk"}: ${action.Comment ?? "Just do it"}`;
  ret += "\n";
  console.log("I am wrongly formatted");

It also helps if you can provide a link to a code sample on rouge.jneen.net.

http://rouge.jneen.net/v3.29.0/javascript/ICAvLyBGb3JtYXQgcmV0dXJuCiAgbGV0IHJldCA9ICIiOwoKICByZXQgKz0gYC8vICR7YWN0aW9uLk5hbWUgPz8gIlVuayJ9OiAke2FjdGlvbi5Db21tZW50ID8_ICJKdXN0IGRvIGl0In1gOwogIHJldCArPSAiXG4iOwogIGNvbnNvbGUubG9nKCJJIGFtIHdyb25nbHkgZm9ybWF0dGVkIik7Cg

Additional context I encountered this issue in Gitlab. They referred me here.

tancnle commented 2 years ago

@legacy3 could you link the GitLab issue here as well? 🙏🏼

legacy3 commented 2 years ago

Hey, first of all looks good thanks :)

Here is the link: https://gitlab.com/gitlab-org/gitlab/-/issues/364595