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

Double space on end of line is not always translated to <br> #14

Open
mnn opened this issue Jun 7, 2020 · 3 comments
Open

Double space on end of line is not always translated to <br> #14

mnn opened this issue Jun 7, 2020 · 3 comments
Labels
bug Something isn't working minor This is a minor issue. pending on external library this issue is pending on another issue/PR of an external library

Comments

@mnn
Copy link

mnn commented Jun 7, 2020

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.

2020-06-07_09-29

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>:
2020-06-07_09-32

@loreanvictor loreanvictor added the bug Something isn't working label Jun 7, 2020
@loreanvictor
Copy link
Contributor

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 &puncsp; after the colon or between the styled text and the colon.

@mnn
Copy link
Author

mnn commented Jun 7, 2020

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 &puncsp;, because in my opinion those spaces followed by a new line are more readable in raw text form.

@loreanvictor
Copy link
Contributor

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.

@loreanvictor loreanvictor added the pending on external library this issue is pending on another issue/PR of an external library label Jun 13, 2020
@loreanvictor loreanvictor added the minor This is a minor issue. label Jun 23, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working minor This is a minor issue. pending on external library this issue is pending on another issue/PR of an external library
Projects
None yet
Development

No branches or pull requests

2 participants