Quantcast
Viewing latest article 20
Browse Latest Browse All 39

Answer by Larnu for Goodbye, Prettify. Hello highlight.js! Swapping out our Syntax Highlighter

Will the default code markdown be changed to code fences?

Currently if you click the code ({}) icon in the editor, then the selected text is still indented (or unindented) by 4 white spaces.

Image may be NSFW.
Clik here to view.
enter image description here

As the indent method's way of defining a language for a specific code block (<!-- language: python --> for example) is deprecated¹, then shouldn't the default functionality of the button be to wrap the code in a code fence (```) instead?

1

The former method of specifying a highlighting language can still be used for HTML code blocks: place an HTML comment <!-- language: lang-or-tag-here --> before the <pre><code> tags and it will work.

Also, this former method hasn't been completely removed for four-space indented code blocks, but merely deprecated. While it will still work for the time being on four-space indented code blocks, it may/will be removed in the future.


Viewing latest article 20
Browse Latest Browse All 39

Trending Articles