From 796ce70a5962ee7cccdcc91b59f33aa3694e5c0c Mon Sep 17 00:00:00 2001 From: Sergey Vartanov Date: Wed, 1 Dec 2021 10:26:52 +0300 Subject: [PATCH] Fix extra icon processing in wiki. --- map_machine/doc/wiki.py | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/map_machine/doc/wiki.py b/map_machine/doc/wiki.py index 7607071..e4eaf08 100644 --- a/map_machine/doc/wiki.py +++ b/map_machine/doc/wiki.py @@ -109,7 +109,12 @@ def generate_new_text( icon, _ = SCHEME.get_icon( EXTRACTOR, table.collection.tags, processed, MapConfiguration() ) - if icon.main_icon.is_default(): + if not icon.main_icon.is_default(): + wiki_text = ( + f"[[Image:Röntgen {icon.main_icon.get_name()}.svg|32px]]\n" + ) + icons.append(icon.main_icon) + elif icon.extra_icons: wiki_text = ( f"Röntgen icon set has additional icon for the tag: " f"[[Image:Röntgen {icon.extra_icons[0].get_name()}.svg|32px]]." @@ -117,10 +122,7 @@ def generate_new_text( ) icons.append(icon.extra_icons[0]) else: - wiki_text = ( - f"[[Image:Röntgen {icon.main_icon.get_name()}.svg|32px]]\n" - ) - icons.append(icon.main_icon) + wiki_text = "" lines: list[str] = old_text.split("\n")