Skip to content

Commit

Permalink
[html] propagate rel attribute from reference nodes
Browse files Browse the repository at this point in the history
See https://developer.mozilla.org/en-US/docs/Web/HTML/Attributes/rel,
this allows third-party extensions to set this attribute on the node and have it propagate to the output HTML,
for example executablebooks/MyST-Parser#857
  • Loading branch information
chrisjsewell authored Jun 28, 2024
1 parent 3b3a7d9 commit 4a8acd5
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions sphinx/writers/html5.py
Original file line number Diff line number Diff line change
Expand Up @@ -325,6 +325,8 @@ def visit_reference(self, node: Element) -> None:
atts['title'] = node['reftitle']
if 'target' in node:
atts['target'] = node['target']
if 'rel' in node:
atts['rel'] = node['rel']
self.body.append(self.starttag(node, 'a', '', **atts))

if node.get('secnumber'):
Expand Down

0 comments on commit 4a8acd5

Please sign in to comment.