Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/sphinx-doc/sphinx.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTakeshi KOMIYA <i.tkomiya@gmail.com>2021-01-16 13:36:25 +0300
committerTakeshi KOMIYA <i.tkomiya@gmail.com>2021-01-16 15:19:38 +0300
commit3248bef3cc45c3b44fd9075142742005f3e4550a (patch)
treef384ff5f9c509a638f1cd6b7d32b60b11a398586 /sphinx/transforms
parent5460ea103bd91ce910e50e11e05c1e5340c2a9e0 (diff)
Fix #4550: The align attribute of figure nodes becomes None by default
To keep compatibility with the standard doctree model of docutils, this stops to use 'default' value as a default value of the align attribute for figure and table nodes.
Diffstat (limited to 'sphinx/transforms')
-rw-r--r--sphinx/transforms/__init__.py8
1 files changed, 7 insertions, 1 deletions
diff --git a/sphinx/transforms/__init__.py b/sphinx/transforms/__init__.py
index 8f8c5d0af..7788c8436 100644
--- a/sphinx/transforms/__init__.py
+++ b/sphinx/transforms/__init__.py
@@ -9,6 +9,7 @@
"""
import re
+import warnings
from typing import TYPE_CHECKING, Any, Dict, Generator, List, Tuple
from docutils import nodes
@@ -21,6 +22,7 @@ from docutils.utils.smartquotes import smartchars
from sphinx import addnodes
from sphinx.config import Config
+from sphinx.deprecation import RemovedInSphinx60Warning
from sphinx.locale import _, __
from sphinx.util import docutils, logging
from sphinx.util.docutils import new_document
@@ -284,6 +286,11 @@ class FigureAligner(SphinxTransform):
"""
default_priority = 700
+ def __init__(self, *args: Any, **kwargs: Any) -> None:
+ warnings.warn('FigureAilgner is deprecated.',
+ RemovedInSphinx60Warning)
+ super().__init__(*args, **kwargs)
+
def apply(self, **kwargs: Any) -> None:
matcher = NodeMatcher(nodes.table, nodes.figure)
for node in self.document.traverse(matcher): # type: Element
@@ -406,7 +413,6 @@ def setup(app: "Sphinx") -> Dict[str, Any]:
app.add_transform(HandleCodeBlocks)
app.add_transform(SortIds)
app.add_transform(DoctestTransform)
- app.add_transform(FigureAligner)
app.add_transform(AutoNumbering)
app.add_transform(AutoIndexUpgrader)
app.add_transform(FilterSystemMessages)