mirror of
https://github.com/xoofx/markdig.git
synced 2026-02-09 13:56:56 +00:00
Nesting custom containers #188
Reference in New Issue
Block a user
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Originally created by @macaba on GitHub (Jan 31, 2018).
I've had a play around to see if nested custom containers works.
(Spoiler: I don't think it does, by design.)
Example markdown:
The undesired result:
The hypothetical desired result:
I'm just putting the finishing touches to an (unrelated) new extension so I am getting familiar with the extension methodology therefore I had a quick look at the custom container extension and couldn't see any explicit functionality that would enable nested containers.
Is this something that could be added easily? Does it make sense to add it?
@xoofx commented on GitHub (Jan 31, 2018):
You control the nesting with different number of characters, but in reverse order of what you tried:
Should give you the following (on babelmark)
As you can see it is matching the behavior of pandoc, so the current design should hopefully be fine.
@macaba commented on GitHub (Jan 31, 2018):
Thank you. The ordering seems a little odd but it works and I'm happy to use it.
As an aside, I don't get the nice indentation that babelmark seems to give:
(Using the exact example you gave)
I'm guessing I'm missing an option somewhere?
@xoofx commented on GitHub (Jan 31, 2018):
That's because the parser is using the same logic than fenced code blocks where you can close a fenced block with more chars than the opening. That's why
::::was somewhat closing also the first row. So the ordering is consistent with the way fenced blocks are working. Pandoc is using the same logic, so It is likely the right consistent convention.No, it is just that babelmark is using an HTML parser after to reformat/normalize the output.
@macaba commented on GitHub (Jan 31, 2018):
Thank you again!
I'm enjoying developing for Markdig and I hope to have an interesting Markdig extension published soon...