Page MenuHomePhabricator

Template wrongly closes <b> tag and marks it as template-affected
Closed, InvalidPublic

Description

Create Template:Test with the following content:

<span style="color:green">HELLO! {{{0}}}</span>

Create a page with the following content:

'''foo {{Test}} bar'''

MW correctly renders this as <p><b>foo <span style="color: green;">HELLO! {{{0}}}</span> bar</b></p>

Parsoid renders this incorrectly as roughly <p><b typeof="mw:Object/Template" about="#mwt1">foo </b><span about="#mwt1"></span><span style="color: green;" about="#mwt1">HELLO! {{{0}}}</span> bar<b></b></p>

Full Parsoid output with data attributes:

<p data-parsoid="{&quot;dsr&quot;:[0,22,0,0]}"><b data-parsoid="{&quot;autoInsertedEnd&quot;:1,&quot;tsr&quot;:[0,3],&quot;dsr&quot;:[0,15,3,0],&quot;src&quot;:&quot;”'foo {{Test}}&quot;}" about="#mwt1" typeof="mw:Object/Template" data-mw="{&quot;parts&quot;:[&quot;”'foo &quot;,{&quot;template&quot;:{&quot;target&quot;:{&quot;wt&quot;:&quot;Test&quot;},&quot;params&quot;:{}}}]}">foo </b><span about="#mwt1"></span><span style="color:green" data-parsoid="{&quot;stx&quot;:&quot;html&quot;}" about="#mwt1">HELLO! {{{0}}}</span> bar<b data-parsoid="{&quot;autoInsertedEnd&quot;:1,&quot;tsr&quot;:[19,22],&quot;dsr&quot;:[19,22,3,0]}"></b></p>


Version: unspecified
Severity: normal

Details

Reference
bz48516

Event Timeline

bzimport raised the priority of this task from to Needs Triage.Nov 22 2014, 1:39 AM
bzimport added a project: Parsoid.
bzimport set Reference to bz48516.

Our output (with PHP preprocessor enabled, as usual) looks ok to me:

<p data-parsoid="{&quot;dsr&quot;:[0,24,0,0]}"><b data-parsoid="{&quot;tsr&quot;:[0,3],&quot;dsr&quot;:[0,24,3,3]}">foo <span style="color:green" data-parsoid="{&quot;tsr&quot;:[7,17],&quot;src&quot;:&quot;{{Inline}}&quot;,&quot;dsr&quot;:[7,17,null,null]}" about="#mwt2" typeof="mw:Object/Template" data-mw="{&quot;target&quot;:{&quot;wt&quot;:&quot;Inline&quot;},&quot;params&quot;:{}}">HELLO! {{{0}}}</span> bar</b></p>

Yup, it does seem to work with the PHP preprocessor enabled. Looks like we observed this bug because:

  • it's broken with the PHP preprocessor disabled (which is fine)
  • localsettings.js.example falsely claims the preprocessor is enabled by default (which doesn't seem to be true, because setting usePHPPreProcessor = true fixed it)

(In reply to comment #2)

Yup, it does seem to work with the PHP preprocessor enabled. Looks like we
observed this bug because:

  • it's broken with the PHP preprocessor disabled (which is fine)
  • localsettings.js.example falsely claims the preprocessor is enabled by

default (which doesn't seem to be true, because setting usePHPPreProcessor =
true fixed it)

Never mind, Trevor's laptop is clearly affected by cosmic rays or something.

[Parsoid component reorg by merging JS/General and General. See bug 50685 for more information. Filter bugmail on this comment. parsoidreorg20130704]