From: Scott Worley Date: Sun, 31 Dec 2023 09:16:00 +0000 (-0800) Subject: Support _ in URLs X-Git-Url: http://git.scottworley.com/paperdoorknob/commitdiff_plain/228bb7bb52ef9df820fb41312144c87ee987434d?ds=sidebyside Support _ in URLs --- diff --git a/paperdoorknob.py b/paperdoorknob.py index 0fd1fde..72ec1a5 100644 --- a/paperdoorknob.py +++ b/paperdoorknob.py @@ -35,7 +35,7 @@ def process(spec: Spec) -> None: spec.geometry.encode('UTF-8') + b']{geometry}\n') spec.texout.write(b'''\\begin{document} -\\newcommand{\\href}[2]{#2\\footnote{#1}} +\\newcommand{\\href}[2]{#2\\footnote{\\detokenize{#1}}} ''') url = flatURL(spec.url) spec.log('Fetching HTML...\r') diff --git a/paperdoorknob_test.py b/paperdoorknob_test.py index c423282..511abb3 100644 --- a/paperdoorknob_test.py +++ b/paperdoorknob_test.py @@ -50,7 +50,7 @@ class BaseTestProcess(ABC): assert re.match(br'''\\documentclass{article} (\\usepackage{[a-z]+}\n)+\\usepackage\[margin=20mm\]{geometry} \\begin{document} -\\newcommand{\\href}\[2\]{#2\\footnote{#1}} +\\newcommand{\\href}\[2\]{#2\\footnote{\\detokenize{#1}}} This is \\href{https://glowfic.com}{glowfic} You \\emph{sure}\?