mirror of
https://gerrit.wikimedia.org/r/mediawiki/extensions/Math
synced 2024-12-18 02:20:46 +00:00
f382be8562
npm: * eslint-config-wikimedia: 0.25.1 → 0.26.0 * grunt-banana-checker: 0.11.0 → 0.11.1 * wdio-mediawiki: 2.1.0 → 2.5.0 * get-func-name: 2.0.0 → 2.0.2 * https://github.com/advisories/GHSA-4q6p-r6v2-jvc5 * postcss: 8.4.30 → 8.4.35 * https://github.com/advisories/GHSA-7fh5-64p2-3v2j Change-Id: I5b01fa01c11a57a180b50bf2f8b3275e69d75f1c
49 lines
1.1 KiB
JavaScript
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
|
|
const 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;
|
|
};
|