highlight.js
highlight.js copied to clipboard
(CMake) Multi-line comments aren't supported properly
Describe the issue
Multi-line comments aren't supported properly, highlight.js seems to treat them like single-line comments which start similarly (#
)
Which language seems to have the issue? CMake
Are you using highlight
or highlightAuto
?
highlight
Sample Code to Reproduce
<!DOCTYPE HTML>
<html>
<head>
<link rel="stylesheet" href="https://unpkg.com/@highlightjs/[email protected]/styles/default.min.css">
<script type="module">
import hljs from 'https://unpkg.com/@highlightjs/[email protected]/es/highlight.min.js';
import cmake from 'https://unpkg.com/@highlightjs/[email protected]/es/languages/cmake.min.js';
hljs.registerLanguage('cmake', cmake);
hljs.highlightAll();
</script>
</head>
<body>
<pre>
<code class="language-cmake">
#[[test
test
test]]
</code>
</pre>
</body>
</html>
Expected behavior
Everything from #[[
to ]]
is treated like a multi-line comment and grayed out
Additional context
@thatbakamono Confirmed, we simply don't know anything about multi-line comments in the grammar currently... this is something that should be super easy to add (there are tons of multi-line comment examples to be found in other grammars)...
If you wanted to take a pass at submitting a PR to resolve this, it'd be very welcome. I've tagged this appropriately.
Would you like to make a pass at a PR?