-
Notifications
You must be signed in to change notification settings - Fork 1.3k
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
fix: better tag selection #2911
Conversation
@Chunjee Could you please explain what issue you are trying to fix and how your fix works? |
I see, in that case, your fix is not correct. Try this example. I have a question: are labels line-based? So can there be any no-space, no-comments after the label on the same line? If they are, then your problem can be fixed like this: @@ -11,8 +11,13 @@ Prism.languages.autohotkey = {
}
],
+ 'tag': {
+ // labels
+ pattern: /^([ \t]*)[^\s,`":]+(?=:[ \t]*$)/m,
+ lookbehind: true
+ },
'string': /"(?:[^"\n\r]|"")*"/m,
- 'tag': /^[ \t]*[^\s:]+?(?=:(?:[^:]|$))/m, //labels
'variable': /%\w+%/,
'number': /\b0x[\dA-Fa-f]+\b|(?:\b\d+(?:\.\d*)?|\B\.\d+)(?:[Ee]-?\d+)?/, |
I am afraid that comments are allowed after a label; and in some unique circumstances, before. After: validLabel: ; a comment Before: /* multiline comment
*/ validLabel: |
Perfect. In that case, you can use the code I commented above. |
Thank you, after some more experimentation I think the issue was a duplicate string definition. |
No description provided.