Parse template parameters to DOM or other non-wikitext types where possible
Closed, ResolvedPublic

Description

To do this, we will need knowledge of which template parameters can be parsed to DOM or other types and which need to remain wikitext. A start tag parameter should probably not be parsed to DOM for example (as a passed-in start tag would be balanced in the process), while most content parameters can. Apart from wikitext string vs. DOM we could also eventually refine parsing further for things like dates, numbers etc. Our DOM spec for templates [1] is already prepared to represent DOM and other representations of individual parameters.

The main thing that we'll need for the next step is information on where it is safe to do so. This information can come from something like TemplateData or DBPedia.

[1]: http://www.mediawiki.org/wiki/Parsoid/MediaWiki_DOM_spec#Template_content


Version: unspecified
Severity: enhancement

bzimport added a project: Parsoid.Via ConduitNov 22 2014, 2:02 AM
bzimport set Reference to bz50587.
GWicke created this task.Via LegacyJul 2 2013, 3:43 PM
marcoil added a comment.Via ConduitFeb 12 2014, 4:42 PM

My current patch (WIP at https://gerrit.wikimedia.org/r/#/c/110381/ ) crashes on parser test "Templates: Indent-Pre: 1e. Wrapping should be based on expanded content" when testing "{{echo|{{echo| }}bar}}", although the same wt works when using parse.js.

Investigating…

gerritbot added a comment.Via ConduitMar 28 2014, 8:42 AM

Change 121421 had a related patch set uploaded by Marcoil:
Bug 50587: Parse template parameters to DOM or other non-wikitext types where possible

https://gerrit.wikimedia.org/r/121421

gerritbot added a comment.Via ConduitApr 8 2014, 4:28 PM

Change 121421 merged by jenkins-bot:
Bug 50587: Parse template parameters to DOM or other non-wikitext types where possible

https://gerrit.wikimedia.org/r/121421

gerritbot added a comment.Via ConduitApr 8 2014, 4:48 PM

Change 123347 had a related patch set uploaded by Marcoil:
Bug 50587: Serialize DOM template parameters back to wikitext

https://gerrit.wikimedia.org/r/123347

gerritbot added a comment.Via ConduitApr 16 2014, 5:22 PM

Change 126725 had a related patch set uploaded by Marcoil:
Bug 50587: Parse template parameters to DOM or other non-wikitext types where possible

https://gerrit.wikimedia.org/r/126725

gerritbot added a comment.Via ConduitApr 16 2014, 5:33 PM

Change 126725 merged by jenkins-bot:
Bug 50587: Parse template parameters to DOM or other non-wikitext types where possible

https://gerrit.wikimedia.org/r/126725

gerritbot added a comment.Via ConduitApr 16 2014, 5:38 PM

Change 126730 had a related patch set uploaded by Marcoil:
Bug 50587: Serialize DOM template parameters back to wikitext

https://gerrit.wikimedia.org/r/126730

gerritbot added a comment.Via ConduitApr 16 2014, 5:39 PM

Change 123347 abandoned by Marcoil:
Bug 50587: Serialize DOM template parameters back to wikitext

Reason:
Rebased in https://gerrit.wikimedia.org/r/126730 .

https://gerrit.wikimedia.org/r/123347

gerritbot added a comment.Via ConduitApr 17 2014, 5:30 PM

Change 126730 merged by jenkins-bot:
Bug 50587: Serialize DOM template parameters back to wikitext

https://gerrit.wikimedia.org/r/126730

gerritbot added a comment.Via ConduitMay 6 2014, 4:49 PM

Change 131729 had a related patch set uploaded by Marcoil:
Bug 50587: Parse template parameters to DOM or other non-wikitext types where possible

https://gerrit.wikimedia.org/r/131729

gerritbot added a comment.Via ConduitMay 6 2014, 4:49 PM

Change 131730 had a related patch set uploaded by Marcoil:
Bug 50587: Serialize DOM template parameters back to wikitext

https://gerrit.wikimedia.org/r/131730

gerritbot added a comment.Via ConduitMay 6 2014, 4:58 PM

Change 131729 merged by jenkins-bot:
Bug 50587: Parse template parameters to DOM or other non-wikitext types where possible

https://gerrit.wikimedia.org/r/131729

gerritbot added a comment.Via ConduitMay 6 2014, 4:58 PM

Change 131730 merged by jenkins-bot:
Bug 50587: Serialize DOM template parameters back to wikitext

https://gerrit.wikimedia.org/r/131730

marcoil added a comment.Via ConduitMay 19 2014, 7:16 AM

This has been merged into master, but it's not enabled by default. To test it out, add

parsoidConfig.addHTMLTemplateParameters = true;

to localsettings.js, or use the option --addHTMLTemplateParameters=true with command line tools.

GWicke added a comment.Via ConduitMay 19 2014, 7:09 PM

Current status: This is not yet enabled in production while we are investigating the performance impact.

Add Comment