Merge pull request #7778 from tk0miya/7723_pdflatex_URL_having_singlequote

Fix #7723: LaTeX: pdflatex crashed when URL contains a single quote
This commit is contained in:
Takeshi KOMIYA 2020-06-07 02:17:45 +09:00 committed by GitHub
commit 588e5bd08c
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 3 additions and 1 deletions

View File

@ -141,6 +141,7 @@ Bugs fixed
* #7646: handle errors on event handlers
* #4187: LaTeX: EN DASH disappears from PDF bookmarks in Japanese documents
* #7701: LaTeX: Anonymous indirect hyperlink target causes duplicated labels
* #7723: LaTeX: pdflatex crashed when URL contains a single quote
* #7756: py domain: The default value for positional only argument is not shown
* #7760: coverage: Add :confval:`coverage_show_missing_items` to show coverage
result to console

View File

@ -1977,7 +1977,8 @@ class LaTeXTranslator(SphinxTranslator):
# mainly, %, #, {, } and \ need escaping via a \ escape
# in \href, the tilde is allowed and must be represented literally
return self.encode(text).replace('\\textasciitilde{}', '~').\
replace('\\sphinxhyphen{}', '-')
replace('\\sphinxhyphen{}', '-').\
replace('\\textquotesingle{}', "'")
def visit_Text(self, node: Text) -> None:
text = self.encode(node.astext())