-
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
Added initial LaTeX support #316
Conversation
Is there anyone here that actually knows LaTeX to review this? |
'comment': /%[\w\W]*/g, | ||
'string': /(\$)(\\?.)*?\1/g, | ||
'punctuation': /[\{\}]/g, | ||
'selector': /[\\][a-zA-Z;,:\.]*/g |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
- A character class with only 1 character is pointless, just use
\\
instead of[\\]
- You can avoid
a-zA-Z
by using thei
flag to make it case insensitive
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Also [\w\W]*
will match the whole file, but Latex uses one line comments. It should be something like: 'comment': /%.*?(\r?\n|$)/g,
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Or you can use the m
flag and add a $
so that it only matches the line
Thanks for the suggestions! I merged that into the files now. Ran it just now on some massive files we used for our graduation project and everything seemed to be highlighted just fine. |
Merged, thanks :) |
I just pushed the minified version. |
Thanks Jannik! |
Awesome. Thanks both :) |
Rebased version of pull #207 on issue #206