mediawiki-extensions-Math/modules/ve-math/ve.dm.MWLatexNode.js
Thiemo Kreuz 801888d34b Use short "@license MIT" according to SPDX
Note there is not even a LICENSE.txt in this code base.

Change-Id: I3dccd4187f4a20e3f040c812c5811298794d469a
2018-04-13 16:04:06 +02:00

49 lines
1.1 KiB
JavaScript

/*!
* VisualEditor DataModel MWLatexNode class.
*
* An abstract class that has most of the common functionality
* for the different tags in the Math extension.
*
* @copyright 2011-2015 VisualEditor Team and others; see AUTHORS.txt
* @license MIT
*/
/**
* DataModel MediaWiki abstract LaTeX node: <math>, <chem>, etc.
*
* @abstract
* @class
* @extends ve.dm.MWInlineExtensionNode
*
* @constructor
* @param {Object} [element]
*/
ve.dm.MWLatexNode = function VeDmMWLatexNode() {
// Parent constructor
ve.dm.MWLatexNode.super.apply( this, arguments );
};
/* Inheritance */
OO.inheritClass( ve.dm.MWLatexNode, ve.dm.MWInlineExtensionNode );
/* Static members */
ve.dm.MWLatexNode.static.tagName = 'img';
/* Static Methods */
/**
* @inheritdoc ve.dm.GeneratedContentNode
*/
ve.dm.MWLatexNode.static.getHashObjectForRendering = function ( dataElement ) {
// Parent method
var hashObject = ve.dm.MWLatexNode.super.static.getHashObjectForRendering.call( this, dataElement );
// The id does not affect the rendering.
if ( hashObject.mw.attrs ) {
delete hashObject.mw.attrs.id;
}
return hashObject;
};