Skip to content
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

MATLAB syntax highlighting does not work properly #819

Closed
AkshatM opened this issue Apr 8, 2015 · 1 comment
Closed

MATLAB syntax highlighting does not work properly #819

AkshatM opened this issue Apr 8, 2015 · 1 comment

Comments

@AkshatM
Copy link

AkshatM commented Apr 8, 2015

highlight.js is currently being used by GitLab for syntax highlighting purposes. My team is running into issues with syntax highlighting in MATLAB files. Could this possibly be fixed?

Here's an example:

gitlabfile

In particular, comments in MATLAB (indicated by a % sign) appear to be ignored, and it's currently failing to detect the end of a string, leading to it highlighting all the following lines as well.

This is not a GitLab issue according to the community.

@isagalaev
Copy link
Member

It is not a bug in Matlab highlighting, but rather a mis-detected language. As noted in the downstream issue you referenced, GitLab currently uses file extensions to determine language for highlighting, and the extension ".m" is currently mapped to Objective C in highlight.js. Switching to auto detection in GitLab should fix this particular case. However auto detection is just another kind of heuristics, and it won't always work correctly either. Still, it's better than trying to highlight Matlab files as Objective C indefinitely.

What we could do, though, is to remove "m" as an alias for Objective C, because it appears to be a pretty widely used extension.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants