| export function mrow(element, targetParent, previousSibling, nextSibling, ancestors) { |
| |
| |
| const children = element.children || [] |
| if (children.length >= 2) { |
| const first = children[0] |
| const last = children[children.length - 1] |
| if (first?.name === 'mo' && first?.attribs?.fence === 'true' && |
| last?.name === 'mo' && last?.attribs?.fence === 'true') { |
| const begChar = first.children?.[0]?.data || '(' |
| const endChar = last.children?.[0]?.data || ')' |
| const dNode = { |
| type: 'tag', name: 'm:d', attribs: {}, children: [ |
| { type: 'tag', name: 'm:dPr', attribs: {}, children: [ |
| { type: 'tag', name: 'm:begChr', attribs: { 'm:val': begChar }, children: [] }, |
| { type: 'tag', name: 'm:endChr', attribs: { 'm:val': endChar }, children: [] }, |
| { type: 'tag', name: 'm:ctrlPr', attribs: {}, children: [] } |
| ]}, |
| { type: 'tag', name: 'm:e', attribs: {}, children: [] } |
| ] |
| } |
| targetParent.children.push(dNode) |
| |
| first.skipInWalker = true |
| last.skipInWalker = true |
| |
| return dNode.children[1] |
| } |
| } |
| |
| return targetParent |
| } |
|
|