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/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, 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