snudown icon indicating copy to clipboard operation
snudown copied to clipboard

Enable codefence markdown extension

Open empyrical opened this issue 5 years ago • 3 comments

This pull request enables the GitHub-style markdown codefences in Snudown (by enabling the MKDEXT_FENCED_CODE flag)

So, if merged, code blocks like this will work on the old reddit design:

```javascript import leftpad from "left-pad"; ```

This also modifies the generated codeblocks somewhat. Previously, it would have a <pre> with a class like this:

<code class="javascript">

Where the class is any un-namespaced user-provided css class, which may not be desirable.

I tweaked it to be like this instead:

<code class="md-code-language-javascript">

So it is namespaced, but still gives people making stylesheets or someone making a browser extension something to work with for determining the language of the code block.

empyrical avatar Nov 18 '18 19:11 empyrical