Page MenuHomePhabricator

General fixes damaging a picture caption when previous text has unbalanced square brackets.
Open, Needs TriagePublic

Description

Here's a long paragraph with unclosed square brackets, followed by File markup with a wikilink in the caption. Run general fixes on this text...

[[he abandoned realism and steered his work towards a more mythical and aestheticizing, almost evasionist tone, as denoted in his decorative plafonds for the Cau Ferrat of 1896 La Pintura, La Poesía, La Música.
[[File:Somni_Joan_Brull.jpg|thumb|''Ensueño'' (1897) by [[Joan Brull]], National Museum of Art of Catalonia, Barcelona]]

...and the square brackets before the word "Joan" get turned round, breaking the caption and ending the File markup prematurely. This converts a small problem into a larger one. Oddly, I find that with fewer characters of plain text in the long paragraph, this does not happen.

Reported at https://en.wikipedia.org/w/index.php?title=Wikipedia_talk:AutoWikiBrowser&oldid=1127953226

Event Timeline

"...with fewer characters of plain text..." If the distinction lies with the intervening newline, then possibly related to the WikiFunctions::Parse::UnbalancedBrackets.cs::DoubleSquareBrackets Regex not having RegexOptions.SingleLine? I haven't had the brainwidth to unwind the Regex, but SingleLine/MultiLine errors are all too familiar.

If that's the case, then probably the pairings of other classes of bracket need to be examined.

With the newline deleted, the bracket fix still occurs.