Skip to content

Commit

Permalink
Merge pull request #7778 from tk0miya/7723_pdflatex_URL_having_single…
Browse files Browse the repository at this point in the history
…quote

Fix #7723: LaTeX: pdflatex crashed when URL contains a single quote
  • Loading branch information
tk0miya authored Jun 6, 2020
2 parents 63dd120 + 85da1b6 commit 588e5bd
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 1 deletion.
1 change: 1 addition & 0 deletions CHANGES
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
3 changes: 2 additions & 1 deletion sphinx/writers/latex.py
Original file line number Diff line number Diff line change
Expand Up @@ -1977,7 +1977,8 @@ def encode_uri(self, text: str) -> str:
# 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())
Expand Down

0 comments on commit 588e5bd

Please sign in to comment.