Skip to content

Commit 39e7d18

Browse files
committed
feat: using rst :file: feature
1 parent 7b46703 commit 39e7d18

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

src/pyconverter/xml2py/ast_tree.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -852,7 +852,10 @@ class FileName(Element):
852852

853853
def to_rst(self, indent="", max_length=100):
854854
"""Return a string to enable converting the element to an RST format."""
855-
return f"``{self[0]}`` {self.tail}"
855+
content = self[0]
856+
if "*" in content:
857+
content = content.replace("*", r"\*")
858+
return f":file:``{content}`` {self.tail}"
856859

857860

858861
class OLink(Element):

0 commit comments

Comments
 (0)