Skip to content

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

Closed
@thatbakamono

Description

@thatbakamono

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugenhancementAn enhancement or new featuregood first issueShould be easier for first time contributorshelp welcomeCould use help from communitylanguage

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions