Template talk:Transclude selected recent additions

Small bug in pictured hooks
Thanks for writing this, it's very handy! I've found a small bug. When "(pictured)" is removed, the output has an extra space where there's punctuation afterwards; eg Skaill House:

Espresso Addict (talk) 12:58, 8 July 2018 (UTC)
 * - Evad37 &#91;talk] 01:52, 9 July 2018 (UTC)
 * Thanks for the rapid fix! Espresso Addict (talk) 01:58, 9 July 2018 (UTC)

I see that the code removes instances of (pictured) or (illustrated) from transclusion, but I searched through a few DYK entries and also found (shown), (featured), and (depicted), as well as some that use multiple words, like (example shown) or (artist's impression depicted). It is probably unwieldy to try to list every possible parenthetical expression that refers to an image or other media, but is there another way to get around this source of potential confusion? --Lasunncty (talk) 08:44, 6 May 2024 (UTC)