Last modified: 2013-09-27 17:09:02 UTC
Test page: http://parsoid.wmflabs.org/mw/User:GWicke/TestUnbalancedTablePage Minimal test case: echo -e '{{echo|<table>}}{{DEFAULTSORT:Page, Main}}' | node parse When parsed with a browser, the meta is foster-parented out and not about-marked.
This is a bug from our html5 tree builder not fostering metas. This will be fixed either when we stop relying on metas not fostering out (and fix the html5 builder), or we explicitly foster them out ourselves. How common is this use case (in terms of priority for fixing this)?
I don't think it is super-common, but if it happens inside templated content then it can result in a major round-trip failure as an about group is cut up. I was thinking about adding a foster-parenting DOMPostProcessor pass for now. That should be pretty straightforward- register for table elements and inspect children for foster-parentable content. If there is any, foster-parent as far up until it is out of foster-parentable position and mark it with any about group found on the table. Not sure if the multi-foster case can really happen. Needs testing.
Looks like this corruption is because content gets fostered out of the table on load in VE. One more instance of fosterable content that needs to be handled. https://en.wikipedia.org/w/index.php?title=List_of_Jessie_episodes&diff=564684769&oldid=564554799
The minimal test case above now looks like this: <body data-parsoid='{"dsr":[0,43,0,0]}'><meta property="mw:PageProp/categorydefaultsort" content="Page, Main" data-parsoid='{"src":"{{echo|<table>}}{{DEFAULTSORT:Page, Main}}","fostered":true,"dsr":[0,42,null,null],"pi":[[{"k":"1","spc":["","","",""]}]]}' about="#mwt1" typeof="mw:Transclusion" data-mw='{"parts":[{"template":{"target":{"wt":"echo","href":"./Template:Echo"},"params":{"1":{"wt":"<table>"}},"i":0}},"{{DEFAULTSORT:Page, Main}}"]}'><table about="#mwt1" data-parsoid='{"stx":"html","autoInsertedEnd":true,"dsr":[null,42,null,0]}'></table> Fixed in 0d6c4aaf4e3621d576c7a15a84b243af71af793b.