Serialize reference tags by themselves on a line

Bug: T242513
Change-Id: I0744eb27e357e63667da86347d3653f063789fca
This commit is contained in:
Arlo Breault 2020-01-14 12:07:57 -05:00
parent ddbca68066
commit cff011ff0a

View file

@ -602,6 +602,16 @@ class References extends ExtensionTag {
}
}
/** @inheritDoc */
public function after( DOMElement $node, DOMNode $otherNode, SerializerState $state ) {
// Serialize new references tags on a new line.
if ( WTUtils::isNewElt( $node ) && !DOMUtils::isBody( $otherNode ) ) {
return [ 'min' => 1, 'max' => 2 ];
} else {
return false;
}
}
/** @inheritDoc */
public function lintHandler(
ParsoidExtensionAPI $extApi, DOMElement $refs, callable $defaultHandler