---
-
name: same-minus
tag: mo
match: "text()='−'" replace:
tree:
node: self
text: "-"
-
name: prime-fix
tag: msup
match:
- "*[1][self::mn] and" - "*[2][(text()='′' or text()='″') and" - "preceding-sibling::*[last()][self::mn]"
replace:
- tree:
node: "*[1]"
text: concat(preceding-sibling::*[last()][text()], *[1][text()])
- delete: preceding-sibling::*[last()]
-
name: repeating-decimal
tag: <mover>
match:
- "*[1][self::mn] and *[2][self::mo][text()='_']"
- "preceding-sibling::*[last()][self::mn]"
variables:
- LineLength:
- x: "*[1][string-length(text())]"
- MnText:
- x: preceding-sibling::*[last()][text()]
- BaseText:
- x: "*[1][text()]"
replace:
- tree:
node: self
xml: >-
<mstack stackalign='right align='baseline' position='0'>
<msline length='$LineLength' position='0'/>
<msrow>
<mn>$MnText$BaseText</mn>
</msrow>
</mstack>
- delete: preceding-sibling::*[last()]
-
name: repeating-decimal-with-mrow-base
tag: <mover>
match:
- "*[1][self::mn] and *[2][self::mo][text()='_']"
- "preceding-sibling::*[last()][self::mn]"
variables:
- LineLength:
- x: "*[1]/*[2][string-length(text())]"
- MnText:
- x: preceding-sibling::*[last()][text()]
- BaseText:
- x: "*[1]/*[2][text()]"
replace:
- tree:
node: self
xml: >-
<mstack stackalign='right align='baseline' position='0'>
<msline length='$LineLength' position='0'/>
<msrow>
<mn>$MnText$BaseText</mn>
</msrow>
</mstack>
- delete: preceding-sibling::*[last()]