jonschlinkert/sublime-markdown-extended

Language names are case-sensitive, indented code blocks do not highlight

nickbclifford opened this issue · 2 comments

I was trying to view a snippet of the Ruby Style Guide in Sublime, but I noticed that all the Ruby sections weren't being highlighted. It took me a while, but I soon realized why this happens. In the original Markdown, the language header is ```Ruby instead of ```ruby and the three backticks are indented with two spaces. Once I changed the case and removed the indentation, it started highlighting properly again. Is there a way to fix this?

In case it matters, I am using a self-tweaked version of the Monokai Neue theme.

image
image
image

Is there a github convention on this by any chance? I'd be happy to make languages case-insensitive, but only if it's in accordance with github's GFM conventions.

I just came across the same problem today. This is not explicitly explained in GFM specification, but yes, GFM parser assumes that indented fenced code blocks may belong to the list item content if its indent matches.

https://help.github.com/articles/creating-and-highlighting-code-blocks/

And here's some Kramdown parser discussion about this issue: gettalong/kramdown#123

Altogether I think you should enable fenced codeblocks also when they're preceeded with any number of tabs or spaces.