Closed s1rd4v3 closed 9 years ago
i'm not sure it's an issue with markdown in general. it's just the nature of the base parser which is not designed to detect the list type change. many modern parsers are able to handle lists like this, including Github's and https://github.com/chjj/marked will also render these lists correctly if smartLists: true
.
i've never heard of this before and it appears to be an ugly "feature" added to accommodate the original parser's illogical choice to not split obviously different lists. there is no good reason to use the original parser instead of any of the newer ones that easily handle obvious cases like this.
the goal of reMarked is to output clean markdown and this feature adds extra cruft that is not necessary if using a modern parser.
thanks for the suggestion, but i see not good reason to add this.
I've just created this issue because of:
The ultimate goal is integration with existing WYSIWYG html editors (eg: Redactor, TinyMCE, CKeditor, Loki, CLeditor) to produce Markdown output.
In your readme.md.
I am using TinyMCE with your parser and i think it's essential to be able to write an odered list followed by an unordered list without taking care of this on the backend.
I'm not a fan of hacks. but in this case i realy think that there's no way around this as it doesnt make sense for me to not be able to break a list, to start another type of list.
But up to you. Thx anyway.
reMarked does not parse markdown, it parses html. if TinyMCE can create 2 different list types, then reMarked will show you 2 different lists in the generated markdown. if you are converting that markdown back to html, then you need to use a parser library that can recognize the different list types without explicit list breaks.
as i mentioned, https://github.com/chjj/marked is easily able to do this on the front-end (or backend via npm) with the smartLists: true
option. try this bidirectional markdown <> html demo i made using redactor.js
, reMarked
and marked
: http://leeoniya.github.io/redactor-js/
Ok. You're right.
i convert the html:
to:
the ouput with the official daringfireball md2html converter is:
this is an known issue of md and can be fixed by placing a
\n\n<!-- -->
after each list or just if theres a list after a list ;-) to split theme clearly.this should ouput:
so i've changed your reMarked.js on line 402 to
in my local code.
cheers and thx for your work