wiki.techinc.nl/tests/phpunit/includes/parser
Subramanya Sastry c8a944a94b Add support to enable Scribunto & Parsoid to handle nowikis properly
* Lua modules have been written to inspect nowiki strip state markers
  and extract nowiki content to further process them. Callers might have
  used nowikis in arguments for any number of reasons including needing
  to have the argument be treated as raw text intead of wikitext.

  While we might add first-class typing features to wikitext, templates,
  extensions, and the like in the future which would let Parsoid process
  template arguments based on type info (rather than as wikitext always),
  we need a solution now to enable modules to work properly with Parsoid.

* The core issue is the decoupled model used by Parsoid where
  transclusions are preprocessed before further processing. Since
  nowikis cannot be processed and stripped during preprocessing,
  Lua modules don't have access to nowiki strip markers in this model.

* In this patch, we change extension tag processsing for nowikis.

  When generating HTML, nowikis are replaced with a 'nowiki' strip
  marker with the nowiki's "innerXML" (only tag contents).

  In this patch, during preprocessing, instead of adding a 'general'
  strip marker with the "outerXML" (tag contents and the tag wrapper),
  we add a 'nowiki' strip marker with its "outerXML".

* Since Parsoid (and any clients using the preprocessed output) will
  unstrip all strip markers, the shift from a general to nowiki
  strip marker won't make a difference.

* To support Scribunto and Lua modules unstrip usage, this patch adds
  new functionality to StripState to replace the (preprocessing-)nowiki
  strip markers with whatever its users want. So, Scribunto could
  pass in a callback that replaces these with the "innerXML" by
  stripping out the tag wrapper.

* Hat tip to Tim Starling for recommending this strategy.

* Updated strip state tests.

Bug: T272507
Bug: T299103
Depends-On: Id6ea611549e98893f53094116a3851e9c42b8dc8
Change-Id: Ied0295feab06027a8df885b3215435e596f0353b
2022-09-01 21:04:42 +00:00
..
CacheTimeTest.php Migrate from setMwGlobals() to overrideConfigValue(s) 2022-08-02 10:14:10 +01:00
CoreParserFunctionsTest.php phpunit: use ->getServiceContainer() in integration tests 2022-01-27 22:04:16 +01:00
LinkHolderArrayIntegrationTest.php Migrate from setMwGlobals() to overrideConfigValue(s) 2022-08-02 10:14:10 +01:00
MagicVariableTest.php tests: Use Title::makeTitle instead of Title::newFromText 2022-07-06 00:44:00 +02:00
PageBundleJsonTraitTest.php Introduce PageBundleJsonTrait for serialization 2022-05-23 17:54:48 +01:00
ParserCacheSerializationTestCases.php Clarify generate-html and make ParserOutput behave as expected 2022-05-03 11:23:08 +02:00
ParserCacheTest.php parser: Mock WikiPage::getContentModel in ParserCacheTest to fix php8.1 2022-07-25 20:51:51 +00:00
ParserMethodsTest.php Add markup to page titles to distinguish the namespace and the main text 2022-08-16 23:36:21 +00:00
ParserOptionsTest.php Migrate from setMwGlobals() to overrideConfigValue(s) 2022-08-02 10:14:10 +01:00
ParserOutputTest.php parser: Prepare to use a <meta> tag for the internal TOC_PLACEHOLDER 2022-08-15 18:54:52 -04:00
ParserPreloadTest.php tests: Use Title::makeTitle instead of Title::newFromText 2022-07-06 00:44:00 +02:00
ParserTest.php Tests: Cleanup some unnecessary nested function calls 2022-06-06 01:02:34 +01:00
PreprocessorTest.php Replace trivial usa of mock builder with createMock() shortcut 2022-07-15 16:43:48 +00:00
RevisionOutputCacheTest.php Replace deprecated calls ParserOptions::newCanonical( 'canonical' ) 2022-06-16 14:22:24 +01:00
SanitizerTest.php Migrate from setMwGlobals() to overrideConfigValue(s) 2022-08-02 10:14:10 +01:00
StripStateTest.php Add support to enable Scribunto & Parsoid to handle nowikis properly 2022-09-01 21:04:42 +00:00
TagHooksTest.php tests: Use Title::makeTitle instead of Title::newFromText 2022-07-06 00:44:00 +02:00
validateParserCacheSerializationTestData.php Hard-deprecate all public property access on CacheTime and ParserOutput. 2021-10-13 13:27:16 -04:00