Skip to content

Commit

Permalink
Merge pull request #120 from g-braeunlich/initializers-fix
Browse files Browse the repository at this point in the history
Improve handling of struct / class initializers
  • Loading branch information
JakubAndrysek authored Jan 15, 2025
2 parents 1545357 + 863a74a commit 2b139a3
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion mkdoxy/property.py
Original file line number Diff line number Diff line change
Expand Up @@ -299,7 +299,10 @@ def __init__(self, xml: Element, parser: XmlParser, kind: Kind):
def md(self, plain: bool = False) -> str:
initializer = self.xml.find("initializer")
if initializer is not None:
return self.parser.paras_as_str(initializer, plain=plain)
initializer_str = self.parser.paras_as_str(initializer, plain=plain).lstrip(" =")
if "\n" in initializer_str:
return "`/* multi line expression */`"
return f"`{initializer_str}`"
else:
return ""

Expand Down

0 comments on commit 2b139a3

Please sign in to comment.