diff --git a/sopel/modules/wiktionary.py b/sopel/modules/wiktionary.py index ff02c95f78..f1a0e2796a 100644 --- a/sopel/modules/wiktionary.py +++ b/sopel/modules/wiktionary.py @@ -49,7 +49,7 @@ def text(html): text = text.replace('(intransitive', '(intr.') text = text.replace('(transitive', '(trans.') text = web.decode(text) - return text + return text.strip() def wikt(word): @@ -73,9 +73,13 @@ def wikt(word): if not is_new_mode: if (mode == 'etymology') and ('
' in line): - etymology = text(line) + if etymology is not None: + # multi-line etymologies do exist (e.g. see "mayhem") + etymology += ' ' + text(line) + else: + etymology = text(line) # 'id="' can occur in definition lines