@@ -26,7 +26,7 @@ import {CHTMLWrapperFactory} from '../WrapperFactory.js';
2626import { CHTMLmo } from './mo.js' ;
2727import { BBox } from '../BBox.js' ;
2828import { MmlMsqrt } from '../../../core/MmlTree/MmlNodes/msqrt.js' ;
29- import { MmlNode , AbstractMmlNode , TextNode , AttributeList } from '../../../core/MmlTree/MmlNode.js' ;
29+ import { MmlNode , AbstractMmlNode , TextNode } from '../../../core/MmlTree/MmlNode.js' ;
3030import { StyleList } from '../CssStyles.js' ;
3131import { DIRECTION } from '../FontData.js' ;
3232
@@ -106,25 +106,10 @@ export class CHTMLmsqrt<N, T, D> extends CHTMLWrapper<N, T, D> {
106106 }
107107
108108 /*
109- * Create an mo wrapper with the given text,
110- * link it in, and give it the right defaults.
111- *
112- * @param {string } text The text for the wrapped element
113- * @return {CHTMLWrapper } The wrapped MmlMo node
109+ * @override
114110 */
115111 protected createMo ( text : string ) {
116- const mmlFactory = ( this . node as AbstractMmlNode ) . factory ;
117- const textNode = ( mmlFactory . create ( 'text' ) as TextNode ) . setText ( text ) ;
118- const mml = mmlFactory . create ( 'mo' , { stretchy : true } , [ textNode ] ) ;
119- const attributes = this . node . attributes ;
120- const display = attributes . get ( 'display' ) as boolean ;
121- const scriptlevel = attributes . get ( 'scriptlevel' ) as number ;
122- const defaults : AttributeList = {
123- mathsize : [ 'math' , attributes . get ( 'mathsize' ) ]
124- } ;
125- mml . setInheritedAttributes ( defaults , display , scriptlevel , false ) ;
126- const node = this . wrap ( mml ) as CHTMLmo < N , T , D > ;
127- node . parent = this ;
112+ const node = super . createMo ( text ) ;
128113 this . childNodes . push ( node ) ;
129114 return node ;
130115 }
0 commit comments