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

Auto-detection of MATLAB language fails #9

Closed
abias opened this issue Dec 3, 2019 · 2 comments
Closed

Auto-detection of MATLAB language fails #9

abias opened this issue Dec 3, 2019 · 2 comments

Comments

@abias
Copy link

abias commented Dec 3, 2019

Hi Mark,

one of our teachers reported that the auto-detection of MATLAB code fails. Especially, the example MATLAB code from https://highlightjs.org/static/demo/ is recognized as Makefile:
Kurs__Alex__Sandkasten

Upstream in highlight.js, there is just one issue covering this issue on highlightjs/highlight.js#819 - but it deals with file extensions and in Moodle the rendered code does not have any file extensions.

I am aware that you are saying on https://moodle.org/plugins/filter_syntaxhighlighter that there isn't any mechanism to force the language to be used, but the MATLAB issue brings me to a point where I think that this could indeed be useful or even needed.

Do you have an opinion or solution proposal for this catch-22?

Cheers,
Alex

@sharpchi
Copy link
Owner

sharpchi commented Apr 2, 2020

Finally looking at this. I have a pull request to be able to specify a language #11 . I think this will go part the way to fixing your issue.
And I noticed that the js I include doesn't contain the language matlab, so I'll look to make sure that's included. I might include a bunch of other languages.

@sharpchi
Copy link
Owner

sharpchi commented Apr 3, 2020

Updated to latest version, and included matlab. Autodetection should work, however, you can also now specify the language using ```lang:matlab;; my matlab code ``` notation

@sharpchi sharpchi closed this as completed Apr 3, 2020
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