An URL such as in a a['href'] can contain URL escape codes, which all start with a %. The LaTeX-converter should escape all % to \% using escape(), or otherwise the unescaped % will be treated like a comment in LaTeX, corrupting the file.
This pull request fixes this by calling escape() on the URL.
URLs in a['href'] should be escaped for LaTeX
I think this is actually wrong, escaping breaks for instance urls with a tilde in them. The hyperref manual says that " The special characters # and ̃ do not need to be escaped in any way.". Unfortunately, it does not say anything about other characters...
@mkamensky Thanks for your comment - do you have any test cases for this?
Yes, this comes from my real life example:
echo '<https://www.math.bgu.ac.il/~amyekut/teaching/2016-17/der-cats-III/course_page.html>' | ruby -rkramdown -e 'puts Kramdown::Document.new(ARGF.read).to_latex'
which does not compile. Thanks!