diff --git a/doc/src/hexdoc/patchouli/text/formatting.py b/doc/src/hexdoc/patchouli/text/formatting.py index 486f6953..32aa7875 100644 --- a/doc/src/hexdoc/patchouli/text/formatting.py +++ b/doc/src/hexdoc/patchouli/text/formatting.py @@ -207,6 +207,11 @@ class Style(ABC, HexdocModel, frozen=True): # close functions if style_str.startswith("/"): + # links + if style_str[1:] == SpecialStyleType.link.value: + return _CloseTag(type=SpecialStyleType.link) + + # all the other functions if style_type := FunctionStyleType.get(style_str[1:]): return _CloseTag(type=style_type) @@ -319,7 +324,11 @@ class LinkStyle(Style, frozen=True): # intentionally not inheriting from Style, because this is basically an implementation # detail of the parser and should not be returned or exposed anywhere class _CloseTag(HexdocModel, frozen=True): - type: FunctionStyleType | Literal[SpecialStyleType.base, SpecialStyleType.color] + type: FunctionStyleType | Literal[ + SpecialStyleType.link, + SpecialStyleType.base, + SpecialStyleType.color, + ] _FORMAT_RE = re.compile(r"\$\(([^)]*)\)")