Parsoid
A bidirectional parser between wikitext and HTML5
|
Provides DOMTraverser visitors that fix template-induced interrupted table cell parsing by recombining table cells and/or reparsing table cell content as attributes. More...
Static Public Member Functions | |
static | reparseTemplatedAttributes (DTState $dtState, Element $cell, ?Element $templateWrapper) |
T46498, second part of T52603. | |
Provides DOMTraverser visitors that fix template-induced interrupted table cell parsing by recombining table cells and/or reparsing table cell content as attributes.
|
static |
T46498, second part of T52603.
Handle wikitext like
where nom expands to style="foo" class="bar"|Bar
. The attributes are tokenized and stripped from the table contents.
This method works well for the templates documented in https://en.wikipedia.org/wiki/Template:Table_cell_templates/doc
Nevertheless, there are some limitations:
$cell known to be
/
FIXME: These checks are insufficient. Previous rounds of table fixups might have created this cell without any templated content (the while loop in handleTableCellTemplates). Till we figure out a reliable test for this, we'll reparse attributes always.
// This DOM pass is trying to bridge broken parses across // template boundaries. So, if templates aren't involved, // no reason to reparse. if ( count( $attributishContent['transclusions'] ) === 0 && !WTUtils::fromEncapsulatedContent( $cell ) ) { return; }