mirror of
https://github.com/NixOS/nixpkgs.git
synced 2025-06-24 02:00:41 +03:00
nixos-render-docs: don't double-escape link titles
This commit is contained in:
parent
f8ffb616a6
commit
8c33134465
1 changed files with 2 additions and 1 deletions
|
@ -67,7 +67,8 @@ class HTMLRenderer(Renderer):
|
||||||
if tokens[i + 1].type == 'link_close':
|
if tokens[i + 1].type == 'link_close':
|
||||||
tag, text = "xref", xref.title_html
|
tag, text = "xref", xref.title_html
|
||||||
if xref.title:
|
if xref.title:
|
||||||
title = f'title="{escape(xref.title, True)}"'
|
# titles are not attribute-safe on their own, so we need to replace quotes.
|
||||||
|
title = 'title="{}"'.format(xref.title.replace('"', '"'))
|
||||||
target, href = "", xref.href()
|
target, href = "", xref.href()
|
||||||
return f'<a class="{tag}" href="{href}" {title} {target}>{text}'
|
return f'<a class="{tag}" href="{href}" {title} {target}>{text}'
|
||||||
def link_close(self, token: Token, tokens: Sequence[Token], i: int) -> str:
|
def link_close(self, token: Token, tokens: Sequence[Token], i: int) -> str:
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue