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

(CMake) Multi-line comments aren't supported properly #3591

Closed
thatbakamono opened this issue Aug 3, 2022 · 2 comments · Fixed by #3644
Closed

(CMake) Multi-line comments aren't supported properly #3591

thatbakamono opened this issue Aug 3, 2022 · 2 comments · Fixed by #3644
Labels
bug enhancement An enhancement or new feature good first issue Should be easier for first time contributors help welcome Could use help from community language

Comments

@thatbakamono
Copy link

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
image

@thatbakamono thatbakamono added bug help welcome Could use help from community language labels Aug 3, 2022
@joshgoebel joshgoebel added enhancement An enhancement or new feature good first issue Should be easier for first time contributors labels Aug 3, 2022
@joshgoebel
Copy link
Member

@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.

@joshgoebel
Copy link
Member

Would you like to make a pass at a PR?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug enhancement An enhancement or new feature good first issue Should be easier for first time contributors help welcome Could use help from community language
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants