From 228bb7bb52ef9df820fb41312144c87ee987434d Mon Sep 17 00:00:00 2001 From: Scott Worley Date: Sun, 31 Dec 2023 01:16:00 -0800 Subject: [PATCH] Support _ in URLs --- paperdoorknob.py | 2 +- paperdoorknob_test.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) 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}\? -- 2.44.1