…g "$1"
postProcess replaces <small>...</small> tags using
smallTagRegex.replaceAllIn(text, (m: Match) => ... "($1)" ...). This uses
Regex.replaceAllIn Match => String overload, which uses the returned string
verbatim (it is run through Matcher.quoteReplacement before being applied)
-- unlike the separate String-replacement overload, it does not expand
"$1" group references. So every non-empty <small>...</small> tag was
replaced with the literal four characters ( $ 1 ), not its actual content.
Confirmed with a direct java.util.regex reproduction of the exact
appendReplacement/quoteReplacement mechanism Regex.replaceAllIn uses: the
old code turns "<small>(extra info)</small>" into the literal text
"($1)"; the fix produces "(extra info)" as intended.
StringParser.parse backs the large majority of plain-text infobox property
extraction across the whole framework, so this corrupts any such text
containing a <small> tag with non-empty content.
Fixed by concatenating the actual captured group instead of writing a
literal $1 placeholder.
Problem
`postProcess` replaces `...` tags using `smallTagRegex.replaceAllIn(text, (m: Match) => ... "($1)" ...)`. This uses `Regex.replaceAllIn`'s `Match => String` overload, which uses the returned string verbatim (it is run through `Matcher.quoteReplacement` before being applied) -- unlike the separate String-replacement overload, it does not expand `$1` group references. So every non-empty `...` tag was replaced with the literal four characters `( $ 1 )`, not its actual content.
Confirmed with a direct `java.util.regex` reproduction of the exact `appendReplacement`/`quoteReplacement` mechanism `Regex.replaceAllIn` uses: the old code turns `"(extra info)"` into the literal text `"($1)"`; the fix produces `"(extra info)"` as intended.
`StringParser.parse` backs the large majority of plain-text infobox property extraction across the whole framework, so this corrupts any such text containing a `` tag with non-empty content.
Fix
Concatenate the actual captured group instead of writing a literal $1 placeholder.
Fixes #855
Summary by CodeRabbit
<small>tags is now preserved in parentheses when processed. Empty<small>content continues to be removed.