Skip to content

Commit 95eb9b8

Browse files
author
Release Manager
committed
sagemathgh-38981: Fix broken rendering of adjacent code blocks
<!-- ^ Please provide a concise and informative title. --> <!-- ^ Don't put issue numbers in the title, do this in the PR description below. --> <!-- ^ For example, instead of "Fixes sagemath#12345" use "Introduce new method to calculate 1 + 2". --> <!-- v Describe your changes below in detail. --> <!-- v Why is this change required? What problem does it solve? --> <!-- v If this PR resolves an open issue, please link to it here. For example, "Fixes sagemath#12345". --> a bug seen in, for example: https://doc-release--sagemath.netlify.app/ht ml/en/reference/structure/sage/structure/category_object#sage.structure. category_object.CategoryObject.variable_names Compare with the fixed page: https://doc-pr-38981--sagemath.netlify.app/ html/en/reference/structure/sage/structure/category_object#sage.structur e.category_object.CategoryObject.variable_names ### 📝 Checklist <!-- Put an `x` in all the boxes that apply. --> - [x] The title is concise and informative. - [x] The description explains in detail what this PR is about. - [x] I have linked a relevant issue or discussion. - [ ] I have created tests covering the changes. - [ ] I have updated the documentation and checked the documentation preview. ### ⌛ Dependencies <!-- List all open PRs that this PR logically depends on. For example, --> <!-- - sagemath#12345: short description why this is a dependency --> <!-- - sagemath#34567: ... --> URL: sagemath#38981 Reported by: Kwankyu Lee Reviewer(s): Frédéric Chapoton
2 parents eaf7655 + 7279faa commit 95eb9b8

File tree

3 files changed

+7
-6
lines changed

3 files changed

+7
-6
lines changed

build/pkgs/configure/checksums.ini

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
tarball=configure-VERSION.tar.gz
2-
sha1=87648980fa41bbd38f9bf45beb7bcdb90e12d613
3-
sha256=cb5129b2e60af70968a6d8de8937b0f9365a2146762bf34a09b4ad7a88c56b8b
2+
sha1=75d6eb488fd370ea17699188dabf78afa295d6d9
3+
sha256=679c7a5c352eeac458ee6574326208df1bc0b30be5c803b952e19a9d2a8b7d32
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
d9c38a7c581e6ed54fbe420122b8bba488b16074
1+
659705e89638fae6821783730c357bf292ebed6e

src/sage_docbuild/conf.py

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -954,16 +954,17 @@ class SagecodeTransform(SphinxTransform):
954954

955955
def apply(self):
956956
if self.app.builder.tags.has('html') or self.app.builder.tags.has('inventory'):
957-
for node in self.document.findall(nodes.literal_block):
957+
for node in list(self.document.findall(nodes.literal_block)):
958958
if node.get('language') is None and node.astext().startswith('sage:'):
959959
from docutils.nodes import container as Container, label as Label, literal_block as LiteralBlock, Text
960960
from sphinx_inline_tabs._impl import TabContainer
961961
parent = node.parent
962962
index = parent.index(node)
963963
prev_node = node.previous_sibling()
964-
if isinstance(node.previous_sibling(), TabContainer):
964+
if isinstance(prev_node, TabContainer):
965965
# Make sure not to merge inline tabs for adjacent literal blocks
966-
parent.insert(index, Text(''))
966+
parent.insert(index, nodes.paragraph())
967+
prev_node = parent[index]
967968
index += 1
968969
parent.remove(node)
969970
# Tab for Sage code

0 commit comments

Comments
 (0)