Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions pep_sphinx_extensions/pep_processor/transforms/pep_zero.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ def apply(self) -> None:
self.startnode.parent.remove(self.startnode)


def _mask_email(ref: nodes.reference) -> nodes.reference:
def _mask_email(ref: nodes.reference) -> nodes.reference | nodes.Text:
"""Mask the email address in `ref` and return a replacement node.

`ref` is returned unchanged if it contains no email address.
Expand All @@ -31,4 +31,4 @@ def _mask_email(ref: nodes.reference) -> nodes.reference:
"""
if not ref.get("refuri", "").startswith("mailto:"):
return ref
return nodes.raw("", ref[0].replace("@", " at "), format="html")
return nodes.Text(ref[0].replace("@", " at "))
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
nodes.reference(
"", text="user@example.com", refuri="mailto:user@example.com"
),
'<raw format="html" xml:space="preserve">user&#32;&#97;t&#32;example.com</raw>',
"user at example.com",
),
(
nodes.reference("", text="Introduction", refid="introduction"),
Expand Down
Loading