codedoc
codedoc copied to clipboard
Double space on end of line is not always translated to <br>
Input (2 spaces after colon on a first line):
**Type parameters**:
`U`: `any` Output [GGArray](#GGArray) item type
is rendered in a browser as:
<p><strong>Type parameters</strong>:
<code>U</code>: <code>any</code> Output <a href="#GGArray">GGArray</a> item type</p>
It looks to me like those 2 spaces are outputted verbatim.
On the project docs is mentioned that CommonMark is supported, I think this is the relevant part: https://spec.commonmark.org/0.29/#example-630
Interestingly, in some other cases it does work:
**Parameters**:
`f`: `FuncLike<T, U>` Mapping function
`ctx`: `any` Context for function
Second hard line break is translated to <br>:

This is an issue with markedjs. I have opened an issue on that project, and will keep this open to monitor the status of that issue.
More information: the issue seems to happen when you have styled text (emphasize, strong), followed by a colon (:), followed by two (or more) spaces, does not result in a hard-line-break using markedjs. For a work-around, you can for example add   after the colon or between the styled text and the colon.
I found \ at the end of a line also works. It's not a critical issue for me, I have access to the markdown generator, so I'll later try modifying it. But in the long run I would prefer having two spaces instead of \ or  , because in my opinion those spaces followed by a new line are more readable in raw text form.
Yes and regardless of readability compliance with common mark is essential. But I suspect it actually wouldn't be long until it is fixed on Marked.