Skip to content

Commit

Permalink
[html] propagate rel attribute from reference nodes (#12489)
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
  • Loading branch information
chrisjsewell authored Jul 3, 2024
1 parent 086a791 commit 8387f4a
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 8387f4a

Please sign in to comment.