Debian Codegraph @

extensions/Math/modules/ve-math/ve.dm.MWLatexNode.js

raw symbols SCIP
1 /*!
2 * VisualEditor DataModel MWLatexNode class.
3 *
4 * An abstract class that has most of the common functionality
5 * for the different tags in the Math extension.
6 *
7 * @copyright See AUTHORS.txt
8 * @license MIT
9 */
10
11 /**
12 * DataModel MediaWiki abstract LaTeX node: <math>, <chem>, etc.
13 *
14 * @abstract
15 * @class
16 * @extends ve.dm.MWInlineExtensionNode
17 *
18 * @constructor
19 * @param {Object} [element]
20 */
21 ve.dm.MWLatexNode = function VeDmMWLatexNode() {
22 // Parent constructor
23 ve.dm.MWLatexNode.super.apply( this, arguments );
24 };
25
26 /* Inheritance */
27
28 OO.inheritClass( ve.dm.MWLatexNode, ve.dm.MWInlineExtensionNode );
29
30 /* Static members */
31
32 ve.dm.MWLatexNode.static.tagName = 'img';
33
34 /* Static Methods */
35
36 /**
37 * @inheritdoc ve.dm.GeneratedContentNode
38 */
39 ve.dm.MWLatexNode.static.getHashObjectForRendering = function ( dataElement ) {
40 // Parent method
41 const hashObject = ve.dm.MWLatexNode.super.static.getHashObjectForRendering.call( this, dataElement );
42
43 // The id does not affect the rendering.
44 if ( hashObject.mw.attrs ) {
45 delete hashObject.mw.attrs.id;
46 }
47 return hashObject;
48 };