summaryrefslogtreecommitdiff
path: root/sphinx/highlighting.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/highlighting.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/highlighting.py')
-rw-r--r--sphinx/highlighting.py8
1 files changed, 4 insertions, 4 deletions
diff --git a/sphinx/highlighting.py b/sphinx/highlighting.py
index 62f10f7a1..bb020850f 100644
--- a/sphinx/highlighting.py
+++ b/sphinx/highlighting.py
@@ -2,7 +2,7 @@
from functools import partial
from importlib import import_module
-from typing import Any, Dict
+from typing import Any, Dict, Optional
from packaging import version
from pygments import __version__ as pygmentsversion
@@ -99,7 +99,7 @@ class PygmentsBridge:
latex_formatter = LatexFormatter
def __init__(self, dest: str = 'html', stylename: str = 'sphinx',
- latex_engine: str = None) -> None:
+ latex_engine: Optional[str] = None) -> None:
self.dest = dest
self.latex_engine = latex_engine
@@ -126,7 +126,7 @@ class PygmentsBridge:
kwargs.update(self.formatter_args)
return self.formatter(**kwargs)
- def get_lexer(self, source: str, lang: str, opts: Dict = None,
+ def get_lexer(self, source: str, lang: str, opts: Optional[Dict] = None,
force: bool = False, location: Any = None) -> Lexer:
if not opts:
opts = {}
@@ -165,7 +165,7 @@ class PygmentsBridge:
return lexer
- def highlight_block(self, source: str, lang: str, opts: Dict = None,
+ def highlight_block(self, source: str, lang: str, opts: Optional[Dict] = None,
force: bool = False, location: Any = None, **kwargs: Any) -> str:
if not isinstance(source, str):
source = source.decode()