Julia: Markdown parsing of newlines in bulleted list

Created on 29 Nov 2018  Â·  2Comments  Â·  Source: JuliaLang/julia

Often, one wants to add new lines in the plain text that are not rendered as new lines in html. Documenter seems to treat these differently than other markdown renderers. For example:

# Test Doc

- A bullet
- Long bullet text **not**
    wrapped to new line
- Long bullet text
wrapped to new line

In the markdown formatters I'm familiar with, the 2nd and third bullets are rendered the same - the 4 spaces in the second bullet don't change anything. Eg, in Atom's markdown preview:

screen shot 2018-11-29 at 9 40 49 am

But julia treats them differently (noticed in Documenter):

screen shot 2018-11-29 at 9 41 03 am

MWE (thanks to @KristofferC - see here) :

julia> using Markdown

julia> md = Markdown.parse("""
       - Long bullet text
       wrapped to new line
       """);

julia> md.content
2-element Array{Any,1}:
 Markdown.List(Any[Any[Paragraph(Any["Long bullet text"])]], -1, false)
 Markdown.Paragraph(Any["wrapped to new line"])                        

julia> md
    •    Long bullet text

  wrapped to new line
markdown stdlib

Most helpful comment

I'll just add that what @kescobo proposes would get us closer to CommonMark too.

All 2 comments

I'll just add that what @kescobo proposes would get us closer to CommonMark too.

Adding a paragraph around each item is also a problem: https://discourse.julialang.org/t/parsing-markdown-lists-add-paragraph-to-items/36169

Julia Markdown parser:

  • qwe

  • rty

Other Markdown parsers:

  • qwe
  • rty
Was this page helpful?
0 / 5 - 0 ratings

Related issues

ararslan picture ararslan  Â·  3Comments

felixrehren picture felixrehren  Â·  3Comments

StefanKarpinski picture StefanKarpinski  Â·  3Comments

Keno picture Keno  Â·  3Comments

omus picture omus  Â·  3Comments