|daniel added a comment.|
Ah, you are right - as long as the DifferenceEngine calls getContent on the revision, it needs to know the slot. DifferenceEngine is a bit of a tangle, perhaps it should be split. But adding a constructor argument is the easiest approach for now.
And it should also be possible to specify multiple slots explicitly with text parameters.
It's needed for stuff like the "live preview" feature.
Ok, I see.
Yes - which is "whatever PreparedEdit::getCombinedParserOutput() returns".
ApiParse doesn't actually use WikiPage::prepareContentForEdit(). I don't think it even can, since ApiParse would need to pass in ParserOptions and that method is designed for preparing a ParserOutput for canonical options.
I note that EditPage previews don't use WikiPage::prepareContentForEdit() either, likely because that too wants to use ParserOptions specific to the user.
prepareContentForEdit() actually constructs two ParserOptions: user-specific options for PST, and canonical options for parsing.
But anyway, you are right: the user should see the per-user rendering of the page in preview, since that is what they see after the page has been saved.
So, let me re-phrase: the mechanism for combining output of multiple slots (whatever that mechanism may be) should be the same in EditPage, ApiParse, and prepareContentForEdit. Perhaps we want prepareContentForPreview? Something like that.
Cc: gerritbot, Aklapper, daniel, Giuliamocci, Adrian1985, Cpaulf30, Lahi, PDrouin-WMF, Gq86, Baloch007, E1presidente, Ramsey-WMF, Cparle, Darkminds3113, SandraF_WMF, Lordiis, GoranSMilovanovic, Adik2382, Th3d3v1ls, Ramalepe, Liugev6, QZanden, Tramullas, Acer, LawExplorer, Lewizho99, Maathavan, Susannaanas, Aschroet, Jane023, Wikidata-bugs, PKM, Base, matthiasmullie, aude, Ricordisamoa, Lydia_Pintscher, Fabrice_Florin, Raymond, Anomie, Steinsplitter, Mbch331
_______________________________________________ Wikidata-bugs mailing list Wikidataemail@example.com https://lists.wikimedia.org/mailman/listinfo/wikidata-bugs