Conversion to HTML does not convert some hyperlinks #672

Closed
opened 2026-01-29 14:42:38 +00:00 by claunia · 2 comments
Owner

Originally created by @molinch on GitHub (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/)

Originally created by @molinch on GitHub (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 <a> 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/)`
claunia added the question label 2026-01-29 14:42:38 +00:00
Author
Owner

@MihaZupan commented on GitHub (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.

@MihaZupan commented on GitHub (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.
Author
Owner

@molinch commented on GitHub (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 commented on GitHub (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.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/markdig#672