Wikifetch: strip inline notes in the form "text[note 1]" from IRC

(cherry picked from commit 9986babd2e57d2ed0a1313e4fedf75d0f019fd8c)
This commit is contained in:
James Lu 2017-09-01 18:02:52 -07:00
parent cfa26351a7
commit 5ca550ac4b

View File

@ -241,8 +241,8 @@ class Wikifetch(callbacks.Plugin):
reply += format('%s %s %u', p, _('Retrieved from'), addr)
reply = reply.replace('&','&')
# Remove inline citations (text[1][2][3], etc.)
reply = re.sub('\[\d+\]', '', reply)
# Remove inline citations (text[1][2][3]) as well as inline notes (text[note 1]).
reply = re.sub('\[[a-z ]*?\d+\]', '', reply)
return reply