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

Conversion to HTML does not convert some hyperlinks #792

Closed
molinch opened this issue Apr 22, 2024 · 2 comments
Closed

Conversion to HTML does not convert some hyperlinks #792

molinch opened this issue Apr 22, 2024 · 2 comments
Labels

Comments

@molinch
Copy link

molinch commented Apr 22, 2024

Thanks for this awesome lib, we use it in several places and found one issue.

Given the following Markdown:
Hello\n\nIt is me (after 1 hard line break)\n\n<br>\nAnd again me (after 2 hard lines break)\nNow just below, [a link to Google](https://google.fr/)

The HTML will not contains an tag for the Markdown link.
Do you have any idea what could lead to this situation?
Maybe you are aware of a workaround we could leverage?

Interestingly having just the following works:
Now just below, [a link to Google](https://google.fr/)

@MihaZupan
Copy link
Collaborator

MihaZupan commented Apr 22, 2024

If you mix HTML tags (<br>) with markdown, you must make sure to end the HTML block with a blank line.

Consider the following examples that differ in new lines:

"<br>\n[label](https://foo)"
HtmlBlock

"<br>\n\n[label](https://foo)"
HtmlBlock, ParagraphBlock, LinkInline, LiteralInline

"<br> [label](https://foo)"
ParagraphBlock, HtmlInline, LiteralInline, LinkInline, LiteralInline

See https://spec.commonmark.org/0.30/#html-blocks for more details.

@molinch
Copy link
Author

molinch commented Apr 23, 2024

Thanks a lot @MihaZupan I had no clue, now it is very clear.
KUDOS for writing such a clear and detailed answer. It was extremely helpful.

@molinch molinch closed this as completed Apr 23, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants