feat: implement mphatom use case always destroying its content

This commit is contained in:
Alexandre Nunes 2020-09-15 12:11:23 -03:00
parent 3d33d61f03
commit 95862aca6a
3 changed files with 15 additions and 0 deletions

View File

@ -14,6 +14,7 @@ import {
MEnclose,
MError,
MOver,
MPhantom,
} from './mathml-tags';
export class Dispatcher {
@ -57,6 +58,8 @@ export class Dispatcher {
return new MError(this._value, this._attributes, this._children);
case 'mover':
return new MOver(this._value, this._attributes, this._children);
case 'mphantom':
return new MPhantom(this._value, this._attributes, this._children);
case 'mrow':
case 'mpadded':
return new GenericContentWrapperTag(this._name, this._value, this._attributes, this._children);

View File

@ -0,0 +1,11 @@
import { MathMLTag } from './MathMLTag';
export class MPhantom extends MathMLTag {
constructor(value: string, attributes: Record<string, string>, children: MathMLTag[]) {
super('mphantom', value, attributes, children);
}
convert(): string {
return '';
}
}

View File

@ -13,3 +13,4 @@ export { MAction } from './MAction';
export { MEnclose } from './MEnclose';
export { MError } from './MError';
export { MOver } from './MOver';
export { MPhantom } from './MPhantom';