Last modified: 2014-09-24 21:35:35 UTC

Wikimedia Bugzilla is closed!

Wikimedia migrated from Bugzilla to Phabricator. Bug reports are handled in Wikimedia Phabricator.
This static website is read-only and for historical purposes. It is not possible to log in and except for displaying bug reports and their history, links might be broken. See T73161, the corresponding Phabricator task for complete and up-to-date bug report information.
Bug 71161 - Support subst: of transclusion blocks through the parseFragment API
Support subst: of transclusion blocks through the parseFragment API
Status: NEW
Product: Parsoid
Classification: Unclassified
serializer (Other open bugs)
unspecified
All All
: High normal
: ---
Assigned To: Parsoid Team
:
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2014-09-23 01:24 UTC by James Forrester
Modified: 2014-09-24 21:35 UTC (History)
5 users (show)

See Also:
Web browser: ---
Mobile Platform: ---
Assignee Huggle Beta Tester: ---


Attachments

Description James Forrester 2014-09-23 01:24:27 UTC
Summary from IRC discussion:

| Parsoid will provide a way for clients to flag that they want a transclusion to be
| substituted, subst=true – if this is set to true, then when VE (or other clients)
| call Parsoid's parseFragment API it will drop the top-level transclusion's
| typeof:mwTransclusion and about:#mw-t\d wrapper, and instead push it down to each
| of the nested transclusions (if any exist). (Default assumption is set to false.)
|
| This will only implement subst: equivalence, not safesubst: yet, which is left for
| future-us to worry about later.)
Comment 1 ssastry 2014-09-23 04:49:09 UTC
This specific approach doesn't work since Parsoid calls the MW API to get expanded wikitext => all nested transclusions are expanded. However, we can call the action=parse API with onlypst=true and process the result in the Parsoid pipeline normally.
Comment 2 Gabriel Wicke 2014-09-23 04:51:49 UTC
We can also retrieve the template wikitext and then parse that with top-level parameters defined. Nested transclusions will then hit expandtemplates as usual.
Comment 3 ssastry 2014-09-23 04:59:05 UTC
Ah yes, that would work as well if we implement the arg-substitution logic for transclusions (or revive it from the codebase if we have since removed it). We should figure out which approach is simpler to implement/maintain. My gut sense is that the onlypst=true one is simpler. 

In either case, we hit the MW api + parse the result.

Note You need to log in before you can comment on or make changes to this bug.


Navigation
Links