Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Bold "@" in block quote doesn't render correctly #1831

Closed
Hashiphoto opened this issue Nov 17, 2020 · 3 comments · Fixed by #1832
Closed

Bold "@" in block quote doesn't render correctly #1831

Hashiphoto opened this issue Nov 17, 2020 · 3 comments · Fixed by #1832
Labels
category: blockquotes category: inline elements L2 - annoying Similar to L1 - broken but there is a known workaround available for the issue released

Comments

@Hashiphoto
Copy link

Hashiphoto commented Nov 17, 2020

Marked version:
1.1.1 and 1.2.4

Describe the bug
We use marked for comments in our app, and having a bold mention in the second line of a block quote doesn't work.

To Reproduce
This input:

> Line 1\n> **@person**

Produces this HTML:

<blockquote>
    <p>
        Line 1
        <br>
        **@person**
    </p>
</blockquote>

I could not repro the bug in the Marked Demo because it does not support newlines/br tags (or I couldn't figure out how to use them).

Expected behavior
The > **@person** line should be wrapped in <strong> tags, but it instead shows the asterisks. This only repros when the bolded mention is after the first line, is at the beginning of the line, and starts with a @.
Expected output

<blockquote>
    <p>
        Line 1
        <br>
        <strong>@person<strong>
    </p>
</blockquote>
@calculuschild
Copy link
Contributor

calculuschild commented Nov 17, 2020

According to the Markdown spec, a newline can be triggered by adding two blank spaces or the \ character at the end of a line, followed by a carriage return like so:

> Line 1\
> **@person**

However, you are correct that in this case Marked does not seem to properly render the <strong> tags.

As a temporary workaround, you can type in the <br> directly, which appears to work in the demo.

@calculuschild calculuschild added L2 - annoying Similar to L1 - broken but there is a known workaround available for the issue category: blockquotes category: inline elements labels Nov 17, 2020
@UziTech
Copy link
Member

UziTech commented Nov 17, 2020

If you set the breaks option you don't need to escape the new line character.

image

demo

@github-actions
Copy link

🎉 This issue has been resolved in version 1.2.5 🎉

The release is available on:

Your semantic-release bot 📦🚀

# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
category: blockquotes category: inline elements L2 - annoying Similar to L1 - broken but there is a known workaround available for the issue released
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants