Default language for non-fenced code blocks
I wish I could provide at the start of the document, as metadata, the default language to use for non-fenced code blocks. The syntax highlighting consistently choose the wrong language. Fenced code blocks are not as nice as simple indentation when writing a document that contains lots and lots of code.
Keyboard shortcuts
Generic
? | Show this help |
---|---|
ESC | Blurs the current field |
Comment Form
r | Focus the comment reply box |
---|---|
^ + ↩ | Submit the comment |
You can use Command ⌘
instead of Control ^
on Mac
Support Staff 1 Posted by Brett on 29 Jan, 2014 03:31 PM
Due to the order in which the conversion happens and the fact that regular Markdown code blocks have no input for language specifier, this isn't feasible (as much as I would agree it would be a handy feature).
For fenced code blocks I'm able to insert a language specifier prior to them being converted to code tags, and the conversion handles adding the class. With regular code blocks I have to wait until after the conversion has taken place, and injecting classes at that point would be difficult.
I suppose I could handle it with JavaScript, parsing for any code blocks that don't have a class already and assigning one based on metadata before running the highlighter. That might work, although the highlighter has a habit of overriding the class anyway (which is a huge pain). I'll take a look at it, though.