Skip to content

Commit

Permalink
fix: function rendering with Replaceable
Browse files Browse the repository at this point in the history
  • Loading branch information
clatapie committed Jan 10, 2025
1 parent 1ab7d0b commit a9051e1
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion src/pyconverter/xml2py/ast_tree.py
Original file line number Diff line number Diff line change
Expand Up @@ -1042,7 +1042,10 @@ def content_equals(self):

def to_rst(self, indent="", max_length=100):
"""Return a string to enable converting the element to an RST format."""
rst_replaceable = f"``{self.content[0]}`` {self.tail}"
tail = self.tail
if tail and "*" in tail:
tail = self.tail.replace("*", "\*")
rst_replaceable = f"``{self.content[0]}`` {tail}"
if isinstance(self.prev_elem, Command):
if any([self.content[0] in arg for arg in self.prev_elem.args]):
rst_replaceable = f"{self.tail}"
Expand Down

0 comments on commit a9051e1

Please sign in to comment.