mirror of
https://gerrit.wikimedia.org/r/mediawiki/extensions/VisualEditor
synced 2024-11-24 22:35:41 +00:00
Allow matchTagNames = null in ve.dm.Converter
This won't usefully register the node with the converter right now, but we need to allow this because the ModelFactory tests will need to have stub nodes with tag-only matches. Change-Id: I023cc8ff647363ab55c73dff39b17ca47e9e6681
This commit is contained in:
parent
47b728bed9
commit
99df776543
|
@ -77,13 +77,11 @@ ve.dm.Converter.getDataContentFromText = function ( text, annotations ) {
|
|||
* @throws {Error} Missing conversion data in node implementation
|
||||
*/
|
||||
ve.dm.Converter.prototype.onNodeRegister = function ( dataElementType, constructor ) {
|
||||
if ( !constructor.static.matchTagNames || !constructor.static.toDomElement ||
|
||||
!constructor.static.toDataElement
|
||||
) {
|
||||
if ( !constructor.static.toDomElement || !constructor.static.toDataElement ) {
|
||||
throw new Error( 'Missing static properties in node implementation of ' + dataElementType );
|
||||
} else {
|
||||
var i,
|
||||
domElementTypes = constructor.static.matchTagNames,
|
||||
domElementTypes = constructor.static.matchTagNames || [],
|
||||
toDomElement = constructor.static.toDomElement,
|
||||
toDataElement = constructor.static.toDataElement;
|
||||
// Registration
|
||||
|
|
Loading…
Reference in a new issue