aramk / crayon-syntax-highlighter

Syntax Highlighter supporting multiple languages, themes, fonts, highlighting from a URL, local file or post text.
https://wordpress.org/plugins/crayon-syntax-highlighter/
GNU General Public License v3.0
1.1k stars 247 forks source link

MATLAB comments not working correctly #145

Open enewton opened 10 years ago

enewton commented 10 years ago

I'm trying to use the MATLAB language, which uses % to indicate start of comments for that line, just like // in C code.

I can see the regex for comments looks vaguely correct, however it appears to match a % to a Tag type, which isn't defined in the MATLAB syntax files.

i.e. If I choose red for Tag and green for Comments, then the following you would expect to be green: % this is all comments

However, the % is red, and 'this is all comments' is black.

Other than that the plugin looks great.

enewton commented 10 years ago

There is also a block comment in MATLAB, but no-one uses it. If you are making edits for the above issue, then it may be worth adding it.

%{ all of this is a block comment %}

lettergram commented 9 years ago

There is still an issue with this

aramk commented 9 years ago

Yeah I haven't had enough free time to look at all the issues. Would love PRs if anyone's willing!

lettergram commented 9 years ago

I think you just need to change the regex to read (%?) to read percentage sign, the period . might be the issue.

neusgaten commented 8 years ago

This is still a issue. Inline Matlab comments are only recognized when there is at least one character prior to the percent, otherwise it is erroneously seen as code.

cminto commented 8 years ago

Same as issue posted here as https://github.com/aramk/crayon-syntax-highlighter/issues/340 (point 1).