Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Enable codefence markdown extension #85

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

empyrical
Copy link

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.

@13steinj
Copy link

Yes please this would help out nearly every programming community on reddit as well as some math and science heavy ones.

@pwildani
Copy link

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.

@empyrical
Copy link
Author

@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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

3 participants