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
Runkit - ES6 Template Literals do not work on dev.to #1431
Comments
|
Thank you for reporting this issue. This is most likely caused by this method https://github.com/thepracticaldev/dev.to/blob/master/app/labor/markdown_parser.rb#L130 |
|
That looks like the culprit! Thank you for taking time to look and label the issue. |
|
Thanks for contributing to this issue. As it has been 90 days since the last activity, we are automatically closing the issue in 7 days. This is often because the request was already solved in some way and it just wasn't updated or it's no longer applicable. If this issue still requires attention, please respond with a comment. Happy Coding! |
|
Still an issue unfortunately. |
|
@mariocsee is this resolved? saw there's a merged PR referenced. |
|
Hey @jessleenyc, I just tested again with this content: and using the preview feature I received this result: Unfortunately, I believe this is still an issue. Cheers. |
|
Adding a code fence around the JavaScript but inside the RunKit tag fixes the issue. It would seem like the easiest fix would be to introduce a preprocessing step in the markdown renderer. We would find all runkit tags and edit their bodies to contain code blocks around their contents before running the Markdown parser. However, this approach would fail the following scenario: Since the Liquid tag loses its meaning once wrapped within a code block. The only bug-free method of solving the issue I can think of would be to use two passes over the markdown. The first renders it as-is and keeps track of which liquid tags are parsed and which are left as-is. The second uses this information to replace the parsed liquid tags of type runkit with code fences. This solution sounds like an over-complication that would better be replaced by documentation, so maybe we could mention in the |
|
Would this solely require adding an explanation to views/pages/_editor_liquid_help.html.erb and views/pages/_editor_guide_text.html.erb? E.g.:
I'm feeling this issue because I just researched how to put backticks in code blocks in Markdown on GitHub. 😂 |



Describe the bug
When writing the markup for a dev.to post using
runkitfor code examples template literals (backticks `) are stripped out.To Reproduce
Steps to reproduce the behavior:
Expected behavior

template literals used in dev.to's runkit embedded environment to be supported
Here is an example from runkits demo page
Screenshots

Markdown:
Result:

Expected:

Additional context
The bug was discovered while updating a post as a request PR here: hardy613/es6-notes#13
The text was updated successfully, but these errors were encountered: