BoboTiG / ebook-reader-dict

Finally decent dictionaries based on the Wiktionary for your beloved eBook reader. Daily updates & 14 languages supported so far.
http://www.tiger-222.fr/?d=2020/04/17/22/14/21-un-dictionnaire-alternatif-et-complet-pour-votre-liseuse
MIT License
418 stars 24 forks source link

[FR] Fix support for "Pas clair" template with no argument #2183

Closed BoboTiG closed 1 month ago

BoboTiG commented 1 month ago

Wikicode:

{{Pas clair}}

Output:

Traceback (most recent call last):
  File "wikidict/render.py", line 507, in render_word
    details = parse_word(word, code, locale)
              ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "wikidict/render.py", line 472, in parse_word
    etymology = find_etymology(word, locale, etyl_data[0])
                ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "wikidict/render.py", line 185, in find_etymology
    definitions.append(process_templates(word, section_item, locale))
                       ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "wikidict/utils.py", line 454, in process_templates
    text = text.replace(tpl, transform(word, tpl[2:-2], locale))
                             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "wikidict/utils.py", line 617, in transform
    return str(eval(templates_multi[locale][tpl]))
               ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "<string>", line 1, in <module>
IndexError: list index out of range

Expected:

<small>&nbsp;</small><sup><i><b>Pas clair</b></i></sup>