Closed raphinesse closed 10 years ago
Thanks!
That was fast :+1:
Unfortunately I just discovered that kramdown allows you to open a code block with three or more ~
characters. As far as I can see it GFM does not allow this. To fix this the language definition would have to be amended to something like this:
<dict>
<key>begin</key>
<!-- changed -->
<string>(```|(~){3,})\s*(java)\s*$</string>
<key>captures</key>
<dict>
<key>1</key>
<dict>
<key>name</key>
<string>punctuation.definition.fenced.markdown</string>
</dict>
<!-- changed -->
<key>3</key>
<dict>
<key>name</key>
<string>variable.language.fenced.markdown</string>
</dict>
</dict>
<key>end</key>
<!-- changed -->
<string>(\1\2*)\n</string>
<key>name</key>
<string>markup.raw.block.markdown markup.raw.block.fenced.markdown</string>
<key>patterns</key>
<array>
<dict>
<key>include</key>
<string>source.java</string>
</dict>
</array>
</dict>
I'm not that firm with these TextMate definitions, so it would be nice if you could take a look at it before I make the necessary changes.
perhaps I should just include a kramdown version?
On second glance that would probably be the right way to do it. Could be quite some work though. As I said, I don't know that much about the capabilities of TextMate grammars but there could be some features which might be tricky to get right. But on the other hand kramdown's syntax is very thoroughly defined.
This adds support for highlighting in kramdown style fenced code blocks.