Skip to content
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

Markdown parsing of newlines in bulleted list #30198

Open
kescobo opened this issue Nov 29, 2018 · 2 comments
Open

Markdown parsing of newlines in bulleted list #30198

kescobo opened this issue Nov 29, 2018 · 2 comments
Labels
stdlib:markdown stdlib Julia's standard library

Comments

@kescobo
Copy link
Contributor

kescobo commented Nov 29, 2018

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
@mortenpi
Copy link
Contributor

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

@cdsousa
Copy link
Contributor

cdsousa commented Mar 19, 2020

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
stdlib:markdown stdlib Julia's standard library
Projects
None yet
Development

No branches or pull requests

4 participants