5
$\begingroup$

There has been this feature request on Meta.SE since 2012: Add syntax highlighting for the MATLAB language

In May 2016 it was marked as [status-completed] and the following answer was posted by an SE admin:

Matlab syntax support is rolling in.

This is basic syntax support without keywords, as these add a lot to the size of the highlighter and do not gzip well at all.

Still - comments should be comments and basic highlighting should work as expected.

This is great. I verified some time ago that it also works on our site: Matlab code gets highlighted correctly if I preface it with <!-- language: lang-matlab -->.

However, it does not work automatically when a thread carries a tag. I noticed it now in this question. It seems that it does work on StackOverflow though, or at least that's how I interpret the following comment:

\o/ It's so working! All my posts suddenly became gorgeous! – Adriaan May 20 at 15:59

So it might be that the automatic highlighting for has not been rolled in specifically on CrossValidated. Hence I post it as a bug.

$\endgroup$
5
$\begingroup$

The community needs to identify such tags, because there is no guarantee that the system could correctly infer the desired highlighting syntax from the tag name. Moderators can indicate which language goes with which tag. I have done so with , so it should be working now.

$\endgroup$
  • $\begingroup$ Wow, cool, thanks @whuber. Had I known that, I would have simply pinged you in chat instead of starting this whole meta thread. I imagined it's something that SE admins would have to take care of. $\endgroup$ – amoeba says Reinstate Monica Oct 11 '16 at 22:40
  • 1
    $\begingroup$ I think you did the right thing, because maybe there are other tags that community members would like to nominate for syntax highlighting. Meta might be a good place to request it. To avoid cluttering this site with requests, though, consider just flagging any thread that bears the tag you care about and make the suggestion there. $\endgroup$ – whuber Oct 11 '16 at 22:42
  • $\begingroup$ Can multiple tags be associated with the same language? E.g. [python] is clearly associated with Python, but [scikit-learn] is not associated with it. So I usually edit to add [python] just to make the syntax highlighting work. Would it make sense to associate such package tags (at least the prominent ones) with the respective languages? The same goes e.g. for [r] and [lme4-nlme], etc. $\endgroup$ – amoeba says Reinstate Monica Oct 11 '16 at 22:46
  • $\begingroup$ Yes. But only one language can be associated with any given tag. $\endgroup$ – whuber Oct 12 '16 at 12:47
  • $\begingroup$ I see. So do you think it's a sensible idea to associate prominent package tags with respective languages? $\endgroup$ – amoeba says Reinstate Monica Oct 12 '16 at 13:15
  • 1
    $\begingroup$ Sure! It could be quite a task to go through all our tags looking for those that should be associated with a language, but any time you encounter one that obviously has an associated language, consider raising a flag. $\endgroup$ – whuber Oct 12 '16 at 13:23
  • $\begingroup$ We could have a meta thread (or partially convert this one) to serve as a dictionary of tags -> languages. I don't know if that appeals (cc @amoeba). $\endgroup$ – gung - Reinstate Monica Oct 12 '16 at 20:07

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .