Note: I wrote this before Eric’s previous post, but my Internet gave out when actually trying to post. So some of what I wrote is already outdated…
The particular problem with the History is that a double quote in the title is merely escaped to \"
. Hence, the WikiText parser splits the title after the backslash. One could try splitregexp
with a negative lookbehind, but would then also need unescaping of the remaining quotes. I might even have tried my hand at it were it not for the mentioned history[]
filter that does it all with basically one line of JavaScript plus the usual filter overhead.
I liked the simplicity so much that I chose the JavaScript module over a WikiText approach, something that I don’t often do, for the exact reasons @EricShulman has mentioned.
@TW_Tones: I removed the quotes from the title and put them into a caption instead. They would be likely to cause more trouble down the road with other custom code in my TW than it’s worth having them. The OP might think differently, though, so I merely wanted to point out an alternative.
Have a nice day
Yaisog
PS: I only use two non-core filters in my own code, history[] and one that converts dates into “human-readable” format like “last Monday” for task lists.