Closed apfelbox closed 10 years ago
Bonus feature: you'll get integration with tools - which build on the spec - for free. For example prism.
Hi @apfelbox I appreciate your point. I ran into this myself with prism on hannah.wf and worked around it by using:
```language-javascript
content
Less than ideal, but it works!
Ultimately this is a problem with the showdown library rather than with Ghost. There are a lot of wonkinesses with the markdown implementation, which we'll address in our editor overhaul project which should be Ghost v0.7 or thereabouts.
Hi @ErisDS, thanks for your response. Yeah, I also thought about the language-javascript
workaround, but it would be nice if it would adapt to other libraries in the long run.
Is the markdown compiler a separate project or is directly from/for Ghost?
@apfelbox The markdown parser is showdown: https://github.com/coreyti/showdown, but we use my fork of it in Ghost to work around issues with new HTML5 elements: https://github.com/ErisDS/showdown
Showdown is unfortunately quite buggy. There have been proposals to either fix the bugs on my fork, or to switch to another parser called marked, but both of these proposals will require a lot of time and effort, and are in my opinion not worth investing in at the present time due to the impending editor project in which overhauling the editor will be our priority.
@apfelbox The problem with pagedown is exactly the same as with with switching to marked. It is a big project to investigate the differences, reimplement our customisations (like the image uploader) and make sure that people's content won't change in unexpected ways. This will take a lot of time and effort. We have an editor project (to do something like this) scheduled for the near future, right now we're focusing on other problems. You can see all of this info in the roadmap.
@ErisDS thank you for your detailed answer. I will leave the ticket open but look out for the editor subproject/overhaul, so that I can possibly try to contribute it myself.
Thank you so far!
@ErisDS I ran into this due to wanting to use Prism as well, I can submit a PR on your fork of showdown if you want.
@ErisDS This is merged on your version of showdown - it would need an update/release and update on package.json, right?
Yep, that's why it's assigned to me :wink:
This is now also being discussed at "Standard Markdown": http://talk.standardmarkdown.com/t/fenced-code-blocks-should-add-class-to-code-rather-than-pre-matching-the-html-best-practice/136
Just for the record: after the domain change, the correct URL is: http://talk.commonmark.org/t/fenced-code-blocks-should-add-class-to-code-rather-than-pre-matching-the-html-best-practice/136
PS: this is now merged in CommonMark (new name of "standard markdown"): http://jgm.github.io/stmd/spec.html#example-81
Hi,
currently fenced code blocks just translate the language (if given) directly into the class: