ParsoidParser: ensure magic variable expansion uses pageLanguageOverride
commit8a650d5d48cf7001dd65e84beea30354d19072c7
authorC. Scott Ananian <cscott@cscott.net>
Wed, 9 Oct 2024 16:25:02 +0000 (9 12:25 -0400)
committerC. Scott Ananian <cscott@cscott.net>
Wed, 9 Oct 2024 16:28:23 +0000 (9 12:28 -0400)
treee760e12349301f57a1a9a6d336554ca4a4352954
parent79896b6e0d68cbb871e98d03d7fee18aa3228a68
ParsoidParser: ensure magic variable expansion uses pageLanguageOverride

This patch adds tests for the caching fix in
Ie76020dc4fa3545f827e1674051530b479f01f31, but these tests also revealed
that the recursive invocation of the legacy parser to expand magic
variables like {{PAGELANGUAGE}} wasn't using the pageLanguageOverride,
aka ParserOptions::getTargetLanguage().

The page language override is used when parsing new context which
doesn't currently exist in the database and therefore doesn't have a
page language set by its title (which doesn't yet exist).

Bug: T376783
Follows-Up: Ie76020dc4fa3545f827e1674051530b479f01f31
Change-Id: If6fe7cf00be6e78ef46181b17f01138383e95e46
includes/parser/Parsoid/Config/PageConfigFactory.php
tests/phpunit/integration/includes/Rest/Handler/Helper/HtmlOutputRendererHelperTest.php