Skip to content

Commit 8387f4a

Browse files
authored
[html] propagate rel attribute from reference nodes (#12489)
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
1 parent 086a791 commit 8387f4a

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

sphinx/writers/html5.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -325,6 +325,8 @@ def visit_reference(self, node: Element) -> None:
325325
atts['title'] = node['reftitle']
326326
if 'target' in node:
327327
atts['target'] = node['target']
328+
if 'rel' in node:
329+
atts['rel'] = node['rel']
328330
self.body.append(self.starttag(node, 'a', '', **atts))
329331

330332
if node.get('secnumber'):

0 commit comments

Comments
 (0)