-
-
Notifications
You must be signed in to change notification settings - Fork 271
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
Suggestion for new syntax #722
Comments
Introducing a new syntax will take a major version change for compatibility reasons and which is currently not planned anytime soon. You could implement a custom syntax highlighter and (ab)use the fenced code block syntax for this which would not require any change to kramdown itself and be backwards compatible:
The syntax highlighter would look for a code block with "language" |
That's extraordinarily clever, thank you. Admittedly I was thinking of the 20-year future of Markdown, seeing that summary/details is very often written in Github issues/comments, and also that Jekyll uses Kramdown. But I don't know where to propose such a change to Markdown. And figuring that the spec usually follows implementation, I thought best to recommend it here. But for my purposes, your solution is great. Thanks again. |
The problem is that there is no common Markdown syntax. Each implementation differs in subtle and not so subtle ways. Luckily most syntax differences are small so running another implementation on some Markdown text will generally work okay-ish. |
Well there's the CommonMark spec which I thought was pretty universal. Also, the code-fence syntax hack wouldn't allow the body contents to be parsed as block-level Markdown. |
Yes, CommonMark is a nice try but still not universal. You could invoke a new parser instance in the custom syntax-highlighter that does the parsing. |
Personally I kind of switched to using HTML for more complicated stuff. For instance, nowadays for images I simply use plain HTML like:
I found that I get a bit more control that way. For most other things I tend Anyway enough of me digressing the issue here! |
This would create <details> and <summary> elements. This appears to be extraordinarily common in Markdown, but everyone just uses HTML.
The text was updated successfully, but these errors were encountered: