Marked v2: Can it handle code fencing attributes?
I've been using Marked v1 since forever, it seems.
Recently I have a use case where I'd like to use Github-style attributes for fencing, which is described here: https://github.com/Python-Markdown/markdown/blob/master/docs/extens...
Does Marked 2 do anything with attributes? Or could it possibly ignore any if specified, even if Marked can't support it? Ignoring would be cool, so that at least the syntax isn't rejected.
My use case is that I'd like to fence some code like so
(using percents here instead of backticks so as not to confuse the discussion software.)
%%%bash
pwd
%%%
But would like to mark it for some extra processing. So I'd like to do something like:
%%%bash { flag }
pwd
%%%
In version 1, if you add such attributes, the fencing is lost.
Comments are currently closed for this discussion. You can start a new one.
Keyboard shortcuts
Generic
? | Show this help |
---|---|
ESC | Blurs the current field |
Comment Form
r | Focus the comment reply box |
---|---|
^ + ↩ | Submit the comment |
You can use Command ⌘
instead of Control ^
on Mac
Support Staff 1 Posted by Brett on 14 Dec, 2024 10:53 PM
Properly formatted, Python language and tag specifiers work fine.
Renders as:
Having both a language specifier AND curly brackets will break it (just as it would Python Markdown, I think).
-Brett
2 Posted by John Norman on 14 Dec, 2024 11:01 PM
Thanks.
On Sat, Dec 14, 2024 at 4:53 PM Brett <[email blocked]>
wrote:
3 Posted by John Norman on 14 Dec, 2024 11:03 PM
(And that example does not render in Marked v1. Correct?)
On Sat, Dec 14, 2024 at 5:01 PM John Norman <[email blocked]> wrote:
Brett closed this discussion on 30 Dec, 2024 06:51 PM.