summaryrefslogtreecommitdiff
path: root/sphinx/util/texescape.py
diff options
context:
space:
mode:
authorAdam Turner <9087854+aa-turner@users.noreply.github.com>2022-07-18 22:49:56 +0100
committerAdam Turner <9087854+aa-turner@users.noreply.github.com>2022-07-18 22:49:56 +0100
commit94024e6efaa23869a6141dba05118c158d3d3f8f (patch)
tree1bfccc5447ca099627c4c31f536d7082b7b9eb6a /sphinx/util/texescape.py
parenta4d41aa889388bf8ee2815d4819235b5ca978a8d (diff)
parenteb0a6c574fd18d5c5d903e5d07cba8cafc376ee0 (diff)
downloadsphinx-git-94024e6efaa23869a6141dba05118c158d3d3f8f.tar.gz
Merge branch '5.x'
# Conflicts: # sphinx/ext/autodoc/__init__.py # sphinx/writers/html5.py
Diffstat (limited to 'sphinx/util/texescape.py')
-rw-r--r--sphinx/util/texescape.py6
1 files changed, 3 insertions, 3 deletions
diff --git a/sphinx/util/texescape.py b/sphinx/util/texescape.py
index 83c78bb38..ba885f695 100644
--- a/sphinx/util/texescape.py
+++ b/sphinx/util/texescape.py
@@ -1,7 +1,7 @@
"""TeX escaping helper."""
import re
-from typing import Dict
+from typing import Dict, Optional
tex_replacements = [
# map TeX special chars
@@ -100,7 +100,7 @@ _tex_hlescape_map: Dict[int, str] = {}
_tex_hlescape_map_without_unicode: Dict[int, str] = {}
-def escape(s: str, latex_engine: str = None) -> str:
+def escape(s: str, latex_engine: Optional[str] = None) -> str:
"""Escape text for LaTeX output."""
if latex_engine in ('lualatex', 'xelatex'):
# unicode based LaTeX engine
@@ -109,7 +109,7 @@ def escape(s: str, latex_engine: str = None) -> str:
return s.translate(_tex_escape_map)
-def hlescape(s: str, latex_engine: str = None) -> str:
+def hlescape(s: str, latex_engine: Optional[str] = None) -> str:
"""Escape text for LaTeX highlighter."""
if latex_engine in ('lualatex', 'xelatex'):
# unicode based LaTeX engine