-
Notifications
You must be signed in to change notification settings - Fork 6
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
Nested lists are not handled properly #6
Comments
Another use case is a paragraph in a nested list: Transform to HTML (correct):megamark(
"1. Foo 1\n" +
"1. Foo 2\n" +
" 1. Bar 1\n" +
"\n" +
" Bar 1 (continued)\n" +
" 1. Bar 2\n" +
"1. Foo 3\n"
)
Transform to Markdown and HTML again (error):megamark(domador(megamark(
"1. Foo 1\n" +
"1. Foo 2\n" +
" 1. Bar 1\n" +
"\n" +
" Bar 1 (continued)\n" +
" 1. Bar 2\n" +
"1. Foo 3\n"
)))
|
Could you PR a fix for this? |
Sadly probably not; I don't think I'll have time in this project. |
@jywarren Maybe you could look into this one? 🎉 |
I think it'll be pretty similar to #8, but I need to spend time on the issues in bevacqua/banksy#5, which are high priority for my own project. For this, it could be similar to the nesting-in-tables code in #8, using an |
I needed to handle this myself to cater for 3 spaces for ordered lists. I put together a quick fix, to allow a configurable number of spaces for ordered and unordered lists. This allows megamark to nest ordered lists, where the number of padding spaces must align with the first non-space character in the parent. This change doesn't handle actual detection of the number of spaces required, but does make it work with short lists - allowing me to specify 3 spaces as an option is good enough. I'll submit the PR, in case it is useful to anybody else. |
Using domador and megamark, a transform from Markdown -> HTML -> Markdown -> HTML fails to preserve nested lists.
Transform to HTML (correct):
Transform back to Markdown:
Transform back to HTML (error):
I'm not sure if this is a bug in domador or megamark, but I think either:
The text was updated successfully, but these errors were encountered: