Page MenuHomePhabricator

Template with a bunch of parser functions isn't treated as a transclusion by the tokenizer
Open, LowPublic

Description

The wikitext below doesn't tokenize as a transclusion.

{{Collapsible list 
| titlestyle = font-weight:normal;text-align:left;background-color:WhiteSmoke; 
| title = {{#expr:1+{{#invoke:Text count|main|text= {{#property:P150}}|pattern=,}}-6}} 
| {{MultiReplace|{{PH wikidata|municipalities}}|%[%[[^%[%]]*Bogo%]%]||%[%[[^%[%]]*Carcar%]%]||%[%[[^%[%]]*Danao%]%]||%[%[[^%[%]]*Naga%]%]||%%[%[[^%[%]]*Talisay%]%]||%[%[[^%[%]]*Toledo%]%]||plain=false}}
}}

Extracted from https://en.wikipedia.org/wiki/Cebu

Event Timeline

ssastry triaged this task as Medium priority.Jun 16 2018, 11:08 PM
ssastry updated the task description. (Show Details)
ssastry moved this task from Needs Triage to Read Views on the Parsoid board.
Vvjjkkii renamed this task from Tokenizer tripped up by wikitext to ksaaaaaaaa.Jul 1 2018, 1:03 AM
Vvjjkkii raised the priority of this task from Medium to High.
Vvjjkkii updated the task description. (Show Details)
Vvjjkkii removed a subscriber: Aklapper.
ssastry renamed this task from ksaaaaaaaa to Tokenizer tripped up by wikitext .Jul 1 2018, 3:22 PM
ssastry lowered the priority of this task from High to Medium.
ssastry updated the task description. (Show Details)
ssastry renamed this task from Tokenizer tripped up by wikitext to Template with a bunch of parser functions isn't treated as a transclusion by the tokenizer.Mar 6 2020, 5:28 PM

I believe a similar issue is occurring on the Bohol (Parsoid) page as reported by JamesLucas and @Quiddity. I'm a novice templater but I think the line {{#expr:1+{{#invoke:String|count|source= {{#property:P150}}|pattern=,}}-1}} is meant to transclude but it doesn't seem to in Parsoid. I've made a sandbox (Parsoid) that shows differing outputs at least:

MW
<div class="mw-parser-output">
  <p>0</p>
  <!-- 
NewPP limit report
Parsed by mw1270
Cached time: 20200318232827
Cache expiry: 2592000
Dynamic content: false
Complications: []
CPU time usage: 0.024 seconds
Real time usage: 0.030 seconds
Preprocessor visited node count: 10/1000000
Post‐expand include size: 2/2097152 bytes
Template argument size: 0/2097152 bytes
Highest expansion depth: 4/40
Expensive parser function count: 0/500
Unstrip recursion depth: 0/20
Unstrip post‐expand size: 0/5000000 bytes
Number of Wikibase entities loaded: 0/400
Lua time usage: 0.005/10.000 seconds
Lua memory usage: 557 KB/50 MB
-->
  <!--
Transclusion expansion time report (%,ms,calls,template)
100.00%    0.000      1 -total
--></div>
Parsoid
<section data-mw-section-id="0" id="mwAQ">
  <span
    about="#mwt2"
    typeof="mw:Transclusion"
    data-mw='{"parts":[{"template":{"target":{"wt":"#expr:1+{{#invoke:String|count|source= {{#property:P150}}|pattern=,}}-1","function":"expr"},"params":{},"i":0}}]}'
    id="mwAg"
  ></span>
</section>
LGoto lowered the priority of this task from Medium to Low.Jun 25 2020, 6:26 PM