Closed NullVoxPopuli closed 3 years ago
Describe the issue I'm trying to highlight an HTML-like language, with this:
const TAG_NAME_RE = regex.concat(/[A-Z_]/, regex.optional(/[A-Z0-9:_.-]*:/), /[A-Z0-9_.-]*/); return { name: 'Ember.JS, Glimmer', aliases: [ 'hbs', 'html.hbs', 'html.handlebars', 'htmlbars' ], case_insensitive: true, contains: [ hljs.COMMENT(/\{\{!--/, /--\}\}/), hljs.COMMENT(/\{\{!/, /\}\}/), hljs.COMMENT(/<!--/, /-->/), // open tag { className: 'tag', begin: regex.concat( /<:?/, regex.lookahead(regex.concat( TAG_NAME_RE, regex.either(/\/>/, />/, /\s/) )) ), end: /\/?>/, contains: [ className: { 1: 'attribute', 2: 'operator' }, match: [ /[A-Za-z0-9-_]+/, /=/ ] ] }, ] };
Which language seems to have the issue? I'm writing it :)
Are you using highlight or highlightAuto?
highlight
highlightAuto
Whatever the developer.html uses ...
Sample Code to Reproduce
<AngleBraketComponent @mustache={{@bla}} @number=123 {{modifier @arg (sub-exp 1 "<- num" (concat "string" "another"))}} data-test-id="test" class="my-class" as |test|>
The developer.html shows:
Expected behavior The tag wraps all the way around until the >
tag
>
Additional context if you clear the contains array, the tag is correctly outlining the entire tag.
contains
Note to self: This is a bug in #3081. startsMode accounts for the new multi-class stuff, but endsMode doesn't so it's closing an extra tag that it should not.
Fixed in the PR.
Describe the issue I'm trying to highlight an HTML-like language, with this:
Which language seems to have the issue? I'm writing it :)
Are you using
highlight
orhighlightAuto
?Whatever the developer.html uses ...
Sample Code to Reproduce
The developer.html shows:![image](https://user-images.githubusercontent.com/199018/113491911-2cabc700-94a2-11eb-8389-1897bca7d004.png)
Expected behavior The
tag
wraps all the way around until the>
Additional context if you clear the
contains
array, thetag
is correctly outlining the entire tag.