yogthos/markdown-clj

Apostrophe in URL causes parser to fail to parse automatic links

Offen

#156 geöffnet am 16.09.2019

 (7 Kommentare) (0 Reaktionen) (0 zugewiesene Personen)Clojure (120 Forks)github user discovery
bughelp wanted

Repository-Metriken

Stars
 (570 Sterne)
PR-Merge-Metriken
 (PR-Metriken ausstehend)

Beschreibung

The automatic link parser fails if URLs contains an apostrophe.

Plain URL

The automatic link normally takes a URL like this: (md-to-html-string "Test: <https://www.google.com>")

And generates an anchor tag like this: "<p>Test: <a href=\"https://www.google.com\">https://www.google.com</a></p>"

URL with apostrophe

But if the link contains an apostrophe: (md-to-html-string "Test: <https://www.page.com/Bob's-page>")

It gets treated as plain text: "<p>Test: <https://www.page.com/Bob's-page></p>"

Alternative syntax [description](url) works fine

(md-to-html-string "Test: [https://www.page.com/Bob's-page](https://www.page.com/Bob's-page)")

"<p>Test: <a href='https://www.page.com/Bob's-page'>https://www.page.com/Bob's-page</a></p>"

I came across this while pasting some random github wiki page URLs into my app.

Contributor Guide