Skip to content

Commit

Permalink
Don't output empty {} in mediawiki schemas
Browse files Browse the repository at this point in the history
  • Loading branch information
IanCa committed Jun 24, 2024
1 parent 69df303 commit 47cf097
Showing 1 changed file with 8 additions and 8 deletions.
16 changes: 8 additions & 8 deletions hed/schema/schema_io/schema2wiki.py
Original file line number Diff line number Diff line change
Expand Up @@ -96,14 +96,14 @@ def _add_blank_line(self):
self.output.append("")

def _format_props_and_desc(self, schema_entry):
prop_string = ""
tag_props = schema_entry.attributes
if tag_props:
prop_string += f"{{{self._format_tag_attributes(tag_props)}}}"
extras_string = ""
attribute_string = self._format_tag_attributes(schema_entry.attributes)
if attribute_string:
extras_string += f"{{{attribute_string}}}"
desc = schema_entry.description
if desc:
if tag_props:
prop_string += " "
prop_string += f"[{desc}]"
if attribute_string:
extras_string += " "
extras_string += f"[{desc}]"

return prop_string
return extras_string

0 comments on commit 47cf097

Please sign in to comment.