From 96ac918a76c7d82300f30cb475164612b97c95fd Mon Sep 17 00:00:00 2001 From: Praecordi Date: Fri, 21 Jul 2023 00:08:44 -0500 Subject: [PATCH 1/4] Fix tab_label error --- sphinx_design/tabs.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/sphinx_design/tabs.py b/sphinx_design/tabs.py index a114170..30a6ee6 100644 --- a/sphinx_design/tabs.py +++ b/sphinx_design/tabs.py @@ -101,6 +101,7 @@ def run(self) -> List[nodes.Node]: textnodes, _ = self.state.inline_text(self.arguments[0], self.lineno) tab_label = nodes.rubric( self.arguments[0], + "", *textnodes, classes=["sd-tab-label"] + self.options.get("class-label", []), ) @@ -260,6 +261,7 @@ def run(self) -> None: # create: label_node = sd_tab_label( + "", "", *tab_label.children, input_id=tab_item_identity, From b16997baa1d1119557599cafb9f2a75ed559b28f Mon Sep 17 00:00:00 2001 From: Praecordi Date: Fri, 21 Jul 2023 00:08:44 -0500 Subject: [PATCH 2/4] Fix tab_label error --- sphinx_design/tabs.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/sphinx_design/tabs.py b/sphinx_design/tabs.py index 5fa915a..0bcca27 100644 --- a/sphinx_design/tabs.py +++ b/sphinx_design/tabs.py @@ -99,6 +99,7 @@ def run(self) -> list[nodes.Node]: textnodes, _ = self.state.inline_text(self.arguments[0], self.lineno) tab_label = nodes.rubric( self.arguments[0], + "", *textnodes, classes=["sd-tab-label", *self.options.get("class-label", [])], ) @@ -255,6 +256,7 @@ def run(self) -> None: # create: label_node = sd_tab_label( + "", "", *tab_label.children, input_id=tab_item_identity, From a3f731c064fa1a8d7cfa42f644239855531154e7 Mon Sep 17 00:00:00 2001 From: Praecordi Date: Fri, 21 Jul 2023 00:08:44 -0500 Subject: [PATCH 3/4] Fix tab_label error --- sphinx_design/tabs.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/sphinx_design/tabs.py b/sphinx_design/tabs.py index 5fa915a..0bcca27 100644 --- a/sphinx_design/tabs.py +++ b/sphinx_design/tabs.py @@ -99,6 +99,7 @@ def run(self) -> list[nodes.Node]: textnodes, _ = self.state.inline_text(self.arguments[0], self.lineno) tab_label = nodes.rubric( self.arguments[0], + "", *textnodes, classes=["sd-tab-label", *self.options.get("class-label", [])], ) @@ -255,6 +256,7 @@ def run(self) -> None: # create: label_node = sd_tab_label( + "", "", *tab_label.children, input_id=tab_item_identity, From 3914144bdc32feb04dd83c72d98f63fcfd702d0c Mon Sep 17 00:00:00 2001 From: Chris Sewell Date: Tue, 21 May 2024 00:38:58 +0200 Subject: [PATCH 4/4] Add regression test --- docs/snippets/myst/tab-options.txt | 2 +- docs/snippets/rst/tab-options.txt | 2 +- tests/test_snippets/snippet_post_tab-options.xml | 3 ++- tests/test_snippets/snippet_pre_tab-options.xml | 3 ++- 4 files changed, 6 insertions(+), 4 deletions(-) diff --git a/docs/snippets/myst/tab-options.txt b/docs/snippets/myst/tab-options.txt index 2917fbb..c406bfe 100644 --- a/docs/snippets/myst/tab-options.txt +++ b/docs/snippets/myst/tab-options.txt @@ -1,7 +1,7 @@ ::::{tab-set} :class: class-set -:::{tab-item} Label +:::{tab-item} **Label** :name: target :selected: :class-container: class-container diff --git a/docs/snippets/rst/tab-options.txt b/docs/snippets/rst/tab-options.txt index 5b9fdfb..6c76f99 100644 --- a/docs/snippets/rst/tab-options.txt +++ b/docs/snippets/rst/tab-options.txt @@ -1,7 +1,7 @@ .. tab-set:: :class: class-set - .. tab-item:: Label + .. tab-item:: **Label** :name: target :selected: :class-container: class-container diff --git a/tests/test_snippets/snippet_post_tab-options.xml b/tests/test_snippets/snippet_post_tab-options.xml index a1aad2c..ff5d699 100644 --- a/tests/test_snippets/snippet_post_tab-options.xml +++ b/tests/test_snippets/snippet_post_tab-options.xml @@ -5,7 +5,8 @@ - Label + + Label Content diff --git a/tests/test_snippets/snippet_pre_tab-options.xml b/tests/test_snippets/snippet_pre_tab-options.xml index 878afe7..57f6dd3 100644 --- a/tests/test_snippets/snippet_pre_tab-options.xml +++ b/tests/test_snippets/snippet_pre_tab-options.xml @@ -5,7 +5,8 @@ - Label + + Label Content