snudown
snudown copied to clipboard
Enable codefence markdown extension
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.
Yes please this would help out nearly every programming community on reddit as well as some math and science heavy ones.
Thanks for the effort, but reddit is not using this markdown parser any more. We're now using a modified comrak parser because, among other reasons, this codebase repeatedly failed fuzz testing.
@pwildani It is still used on old reddit, and the fact old reddit doesn't have codefences while new reddit does is a major point of awkwardness for users.