Subramanya Sastry has uploaded a new change for review.

Change subject: Fix tpl-encap. when entire tpl content is fostered out of a 
table.
......................................................................

Fix tpl-encap. when entire tpl content is fostered out of a table.

* In certain scenarios, entire template content is fostered out of
  a containing table.  Simple example:

  {|
  {{echo|foo}}
  |}

  Existing code couldn't handle this case.  Fixed encapsulation to
  recognize this fostering scenario and expand the template range
  to include the table and fix DSR.

  This example is a simplified case that mimics this usage from
  many WP pages (en:Almirante Latorre-class battleship)

  {|{{Infobox ship begin}}
  {{Infobox ship image
  |Ship image=[[File:Chilean battleship Almirante Latorre 2.jpg|300px]]
  |Ship caption=''Almirante Latorre'' in the 1930s
  }}
  |}

  Because of problems correctly parsing content of this template,
  the {{Infobox ship image.. }} template gets fostered out of the
  table and needs to be properly protected and round-tripped back
  despite the parse errors.

* Also refactored data-parsoid attribute fetch into a function and
  cleaned up those uses.

* Added possible DSR fix in a similar, but different fostering
  scenario.

  {|
  {{echo|a
  <div>b</div>}}
  |}

  The opening table in en:Almirante Latorre-class battleship
  won't RT properly without this fix.  But, there is also a
  caveat documented in the code -- worth thinking about.

* No change in parser tests -- but the above examples should be
  added to parserTests.txt

Change-Id: Ic807ef492dc72ca1d996d2e2227d7c51221be6de
---
M js/lib/mediawiki.DOMPostProcessor.js
1 file changed, 141 insertions(+), 52 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/Parsoid 
refs/changes/73/31173/1
--
To view, visit https://gerrit.wikimedia.org/r/31173
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: Ic807ef492dc72ca1d996d2e2227d7c51221be6de
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/Parsoid
Gerrit-Branch: master
Gerrit-Owner: Subramanya Sastry <[email protected]>

_______________________________________________
MediaWiki-commits mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits

Reply via email to