Skip to content

Commit

Permalink
Revert "fix: don't apply label transforms (MyST does this)"
Browse files Browse the repository at this point in the history
This reverts commit 8f8ddc8.
  • Loading branch information
agoose77 committed Aug 21, 2024
1 parent 77e684f commit 3cab6bf
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions src/sphinx_ext_mystmd/transform.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
from sphinx.util import logging


from .utils import normalize_label


logger = logging.getLogger(__name__)
Expand Down Expand Up @@ -87,7 +88,9 @@ def inherit_node_info(self, node, docutils_node):
if len(ids) > 1:
print(f"Warning, found multiple ids: {ids}, using {longest_id}")

node["label"] = longest_id
identifier, label, _ = normalize_label(longest_id)
node["identifier"] = identifier
node["label"] = label

def push_myst_node(self, node, docutils_node=None):
self.parent_result["children"].append(node)
Expand Down Expand Up @@ -144,7 +147,7 @@ def visit_reference(self, node):
)
elif node.get("refuri"):
return self.enter_myst_node(
{"type": "link", "url": node['refuri'], "children": []}, node
{"type": "link", "url": node["refuri"], "children": []}, node
)
else:
raise
Expand Down

0 comments on commit 3cab6bf

Please sign in to comment.