-
-
Notifications
You must be signed in to change notification settings - Fork 121
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
Apostrophe in URL causes parser to fail to parse automatic links #156
Comments
Thanks for the report. I'll try take a look when I get a chance, but good to know there's a workaround in the meantime. Looks like the proper thing to do would be to consolidate the logic for handling both kinds of URL definitions. |
I was mistaken about
If it used double quotes it would work fine:
|
yeah there's not escaping happening in the parser |
Hey. Clojure noob looking for an issue. Is this one up for grabs? |
It sure is :) |
Cool. I might need some help, but will dig into the code first. |
Oh yeah sure thing, I can help point you in the right direction if you get stuck on anything. |
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.
The text was updated successfully, but these errors were encountered: