-
-
Notifications
You must be signed in to change notification settings - Fork 269
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
Is there a way to stop the ampersand symbol from being converted to html in a URL? #39
Comments
The Amazon url's seem to redirect to the correct item even with the converted "&"... now I'm curious as to why Kramdown converts the ampersands in a URL instead of leaving them alone. |
It is correct behavior for kramdown to encode ampersands. |
svnpenn, now I'm a bit confused...the doc you pointed to says "When writing the same URL in a plain text email message or in the location bar of your browser, you would use "&" and not "&"."....Kramdown is converting it to the HTML "&" in the clickable URL.... |
No. $ kramdown <<< '[some link](http://amazon.com?foo=111&bar=222)'
<p><a href="http://amazon.com?foo=111&bar=222">some link</a></p> |
@svnpenn is correct. Values of all attributes in (X)HTML must be correctly formatted so that no problems arise. Modern browsers are able to recover from basic errors but it is better to be on the safe side. As stated on W3C's HTML documentation the As a general rule: In HTML text and attribute values all |
Thanks gettalong and svnpenn I learned something new...I missed this part in svnpenn's ref: "With HTML, the browser translates "&" to "&" so the Web server would only see "&" and not "&" in the query string of the request." -- I saw the "&" in the Firefox browser bar but didn't realize that the webserver was seeing "&" as it should. |
You are welcome! It could have been a problem with kramdown, so better safe than sorry 😄 |
So it looks like kramdown automatically converts the "&" symbol into its proper HTML "&"....It even does this in an Amazon affiliate URL for example. Is there a way to get it to stop doing this at least in this kramdown markup:
The text was updated successfully, but these errors were encountered: