Correctly handle wikilinks with trailing punctuation