diff options
author | Takeshi KOMIYA <i.tkomiya@gmail.com> | 2018-12-16 00:32:10 +0900 |
---|---|---|
committer | GitHub <noreply@github.com> | 2018-12-16 00:32:10 +0900 |
commit | c70e65fc6cd04d02df4f7911025f534dbd27cc20 (patch) | |
tree | 1e8614ac5516dace99ef1df4d203081662c7c2d6 /sphinx/util/rst.py | |
parent | d6d4406ce987cc8823d1b3a33be3a418bcd2a59d (diff) | |
parent | 79eec90f36f5a74e24cfd6740126396fd6567e07 (diff) | |
download | sphinx-git-c70e65fc6cd04d02df4f7911025f534dbd27cc20.tar.gz |
Merge branch 'master' into 5770_doctest_refers_highlight_language
Diffstat (limited to 'sphinx/util/rst.py')
-rw-r--r-- | sphinx/util/rst.py | 9 |
1 files changed, 4 insertions, 5 deletions
diff --git a/sphinx/util/rst.py b/sphinx/util/rst.py index 1ad7bc468..097e93c74 100644 --- a/sphinx/util/rst.py +++ b/sphinx/util/rst.py @@ -25,7 +25,6 @@ if False: # For type annotation from typing import Generator # NOQA from docutils.statemachine import StringList # NOQA - from sphinx.util.typing import unicode # NOQA logger = logging.getLogger(__name__) @@ -34,7 +33,7 @@ symbols_re = re.compile(r'([!-\-/:-@\[-`{-~])') # symbols without dot(0x2e) def escape(text): - # type: (unicode) -> unicode + # type: (str) -> str text = symbols_re.sub(r'\\\1', text) text = re.sub(r'^\.', r'\.', text) # escape a dot at top return text @@ -42,7 +41,7 @@ def escape(text): @contextmanager def default_role(docname, name): - # type: (unicode, unicode) -> Generator + # type: (str, str) -> Generator if name: dummy_reporter = Reporter('', 4, 4) role_fn, _ = roles.role(name, english, 0, dummy_reporter) @@ -57,7 +56,7 @@ def default_role(docname, name): def prepend_prolog(content, prolog): - # type: (StringList, unicode) -> None + # type: (StringList, str) -> None """Prepend a string to content body as prolog.""" if prolog: pos = 0 @@ -80,7 +79,7 @@ def prepend_prolog(content, prolog): def append_epilog(content, epilog): - # type: (StringList, unicode) -> None + # type: (StringList, str) -> None """Append a string to content body as epilog.""" if epilog: content.append('', '<generated>', 0) |