Skip to content

Commit

Permalink
Ignore empty table attributes in moinwiki_in
Browse files Browse the repository at this point in the history
  • Loading branch information
UlrichB22 committed Aug 23, 2024
1 parent 739477b commit 4e6c7bc
Showing 1 changed file with 10 additions and 5 deletions.
15 changes: 10 additions & 5 deletions src/moin/converters/moinwiki_in.py
Original file line number Diff line number Diff line change
Expand Up @@ -80,11 +80,16 @@ class _TableArguments:

def arg_repl(self, args, arg, key=None, value_u=None, value_q1=None, value_q2=None):
key = self.map_keys.get(key, key)
value = (value_u or value_q1 or value_q2).encode("ascii", errors="backslashreplace").decode("unicode-escape")
if key:
args.keyword[key] = value
else:
args.positional.append(value)
if value_u or value_q1 or value_q2:
value = (
(value_u or value_q1 or value_q2).encode("ascii", errors="backslashreplace").decode("unicode-escape")
)
if key:
args.keyword[key] = value
else:
args.positional.append(value)
elif key:
logging.warning(f"No value supplied for {key} attribute, ignored.")

def number_columns_spanned_repl(self, args, number_columns_spanned):
args.keyword["number-columns-spanned"] = int(number_columns_spanned)
Expand Down

0 comments on commit 4e6c7bc

Please sign in to comment.