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

  • when tag is used for references; - # make sure those are not excluded (see e.g., abecedarian). + # make sure those are not excluded (e.g. see "abecedarian"). elif ('id="' in line) and ('
  • ' not in line): mode = None elif (mode is not None) and ('
  • ' in line):