Open ghivert opened 1 month ago
Which parser are you having trouble with? All markdown specs I've read while slowly making a parser say that preceding whitespace is permitted and has no impact on the document.
Oh! Thanks for your answer!
I'm using Showdown JS, because of habits mainly. It does not support leading space as you can see in the live demo. My bad for that one, I was 100% convinced MD specs forbad leading space, but I cannot find any sources ensuring this behaviour. I think Showdown should be modified.
I'm still wondering about the leading space, for the code part. Let's say the doc is:
" Bla\n\n ```gleam\n\n io.debug("hello gleam")\n\n ```"
Which translates to
Bla
```gleam
io.debug("hello gleam")
Can we be sure parsers will get rid of leading spaces in code blocks? Because I think we'd like to have
```gleam
io.debug("hello gleam")
And not
io.debug("hello gleam")
Is it a parser thing? Should it be handled in the code directly?
I think that is a problem with that specific markdown parser, but it'd still be good to resolve this. We do have some space trimming code that we use when rendering HTML documentation, let's apply that to the module interface docs too.
Hi!
In the documentation fields, there's an undesired leading space for every line.
Here's an example, from the package interface of the
gleam_stdlib
right now (append
function here):I suspect it's due to the
///
comments removed, but the space between the triple slash and the comments themselves are still there. It's a bug, because the string as-is is not a valid markdown string.