Skip to content

Commit bce0090

Browse files
authored
Merge pull request #44 from JWCook/fix-rst-inliner-state
Fixes #42
2 parents b80bf8c + 672ed5b commit bce0090

File tree

2 files changed

+6
-2
lines changed

2 files changed

+6
-2
lines changed

docs/dev/index.rst

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
1+
.. tags:: development
2+
13
Contribute
24
==========
35

4-
.. tags:: development
5-
66
All contributions are welcome in ``sphinx-tags``! All contributors and
77
maintainers are expected to follow the `PSF Code of Conduct
88
<https://github.com/psf/community-code-of-conduct>`__.

src/sphinx_tags/__init__.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -73,6 +73,10 @@ def _get_badge_node(self, tag: str, relative_tag_dir: Path) -> List[nodes.Node]:
7373
"""Get a sphinx-design reference badge for the given tag"""
7474
from sphinx_design.badges_buttons import XRefBadgeRole
7575

76+
# Required to set Inliner state, since we're directly creating a role object.
77+
# Typically this would be done when parsing the role from document text.
78+
text_nodes, messages = self.state.inline_text("", self.lineno)
79+
7680
# Ref paths always use forward slashes, even on Windows
7781
tag_ref = f"{tag} <{relative_tag_dir.as_posix()}/{tag}>"
7882
tag_color = self._get_tag_color(tag)

0 commit comments

Comments
 (0)