mirror of
https://github.com/sphinx-doc/sphinx.git
synced 2025-02-25 18:55:22 -06:00
Merge branch '1.7-release' into 4275_update_strftime
This commit is contained in:
2
CHANGES
2
CHANGES
@@ -26,6 +26,8 @@ Bugs fixed
|
|||||||
* #4472: DOCUMENTATION_OPTIONS is not defined
|
* #4472: DOCUMENTATION_OPTIONS is not defined
|
||||||
* #4491: autodoc: prefer _MockImporter over other importers in sys.meta_path
|
* #4491: autodoc: prefer _MockImporter over other importers in sys.meta_path
|
||||||
* #4490: autodoc: type annotation is broken with python 3.7.0a4+
|
* #4490: autodoc: type annotation is broken with python 3.7.0a4+
|
||||||
|
* utils package is installed
|
||||||
|
* #3952: apidoc: module header is too escaped
|
||||||
* #4275: Formats accepted by sphinx.util.i18n.format_date are limited
|
* #4275: Formats accepted by sphinx.util.i18n.format_date are limited
|
||||||
|
|
||||||
Testing
|
Testing
|
||||||
|
|||||||
@@ -37,6 +37,8 @@ exclude = .git,.tox,.venv,tests/*,build/*,doc/_build/*,sphinx/search/*,sphinx/py
|
|||||||
[flake8:local-plugins]
|
[flake8:local-plugins]
|
||||||
extension =
|
extension =
|
||||||
X101 = utils.checks:sphinx_has_header
|
X101 = utils.checks:sphinx_has_header
|
||||||
|
paths =
|
||||||
|
.
|
||||||
|
|
||||||
[mypy]
|
[mypy]
|
||||||
python_version = 2.7
|
python_version = 2.7
|
||||||
|
|||||||
2
setup.py
2
setup.py
@@ -214,7 +214,7 @@ setup(
|
|||||||
'Topic :: Utilities',
|
'Topic :: Utilities',
|
||||||
],
|
],
|
||||||
platforms='any',
|
platforms='any',
|
||||||
packages=find_packages(exclude=['tests']),
|
packages=find_packages(exclude=['tests', 'utils']),
|
||||||
include_package_data=True,
|
include_package_data=True,
|
||||||
entry_points={
|
entry_points={
|
||||||
'console_scripts': [
|
'console_scripts': [
|
||||||
|
|||||||
@@ -23,13 +23,15 @@ if False:
|
|||||||
# For type annotation
|
# For type annotation
|
||||||
from typing import Generator # NOQA
|
from typing import Generator # NOQA
|
||||||
|
|
||||||
symbols_re = re.compile(r'([!-/:-@\[-`{-~])')
|
symbols_re = re.compile(r'([!--/:-@\[-`{-~])') # symbols without dot(0x2e)
|
||||||
logger = logging.getLogger(__name__)
|
logger = logging.getLogger(__name__)
|
||||||
|
|
||||||
|
|
||||||
def escape(text):
|
def escape(text):
|
||||||
# type: (unicode) -> unicode
|
# type: (unicode) -> unicode
|
||||||
return symbols_re.sub(r'\\\1', text) # type: ignore
|
text = symbols_re.sub(r'\\\1', text) # type: ignore
|
||||||
|
text = re.sub(r'^\.', r'\.', text) # escape a dot at top
|
||||||
|
return text
|
||||||
|
|
||||||
|
|
||||||
@contextmanager
|
@contextmanager
|
||||||
|
|||||||
@@ -14,3 +14,5 @@ from sphinx.util.rst import escape
|
|||||||
def test_escape():
|
def test_escape():
|
||||||
assert escape(':ref:`id`') == r'\:ref\:\`id\`'
|
assert escape(':ref:`id`') == r'\:ref\:\`id\`'
|
||||||
assert escape('footnote [#]_') == r'footnote \[\#\]\_'
|
assert escape('footnote [#]_') == r'footnote \[\#\]\_'
|
||||||
|
assert escape('sphinx.application') == r'sphinx.application'
|
||||||
|
assert escape('.. toctree::') == r'\.. toctree\:\:'
|
||||||
|
|||||||
Reference in New Issue
Block a user