Skip to content

Commit

Permalink
wmlunits: Skip race names consisting of nothing but whitespace
Browse files Browse the repository at this point in the history
They mess the markup up and aren't usually intended to be included in
the unit tree in the first place.
  • Loading branch information
irydacea committed Aug 27, 2017
1 parent 299414e commit 32169bf
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion data/tools/unit_tree/html_output.py
Expand Up @@ -584,6 +584,11 @@ def end_menu(is_table_container=False):
racenames += [("-", "-")] + sorted(r[1].items())

for racename, rid in racenames:
# Some add-ons use race names consisting of only whitespace for
# hiding races in the UI. We need to skip those since otherwise
# they result in unusual markup (e.g. invisible <a> elements).
if not racename.strip():
continue
if racename == "-":
add_menuitem_placeholder()
else:
Expand Down Expand Up @@ -622,7 +627,10 @@ def end_menu(is_table_container=False):
got_menu = False
menuid = 0
for r in racelist:
if not r:
# Some add-ons use race names consisting of only whitespace for
# hiding races in the UI. We need to skip those since otherwise
# they result in unusual markup (e.g. invisible <a> elements).
if not r.strip():
continue
if got_menu:
end_menu()
Expand Down

0 comments on commit 32169bf

Please sign in to comment.