mirror of
https://github.com/overleaf/overleaf.git
synced 2024-11-21 20:47:08 -05:00
Merge pull request #17393 from overleaf/mj-tikzcd
[cm6] Don't decorate tikzcd environments GitOrigin-RevId: bf499432d67cefe12576fc135f4564b97a1b2c13
This commit is contained in:
parent
a4b7c5f468
commit
60d38285ea
1 changed files with 16 additions and 11 deletions
|
@ -715,6 +715,7 @@ export const atomicDecorations = (options: Options) => {
|
||||||
return false // no markup in input content
|
return false // no markup in input content
|
||||||
} else if (nodeRef.type.is('Math')) {
|
} else if (nodeRef.type.is('Math')) {
|
||||||
// math equations
|
// math equations
|
||||||
|
let passToMathJax = true
|
||||||
|
|
||||||
const ancestorNode =
|
const ancestorNode =
|
||||||
ancestorNodeOfType(state, nodeRef.from, '$MathContainer') ||
|
ancestorNodeOfType(state, nodeRef.from, '$MathContainer') ||
|
||||||
|
@ -743,6 +744,9 @@ export const atomicDecorations = (options: Options) => {
|
||||||
if (environmentName) {
|
if (environmentName) {
|
||||||
// use the outer content of environments that MathJax supports
|
// use the outer content of environments that MathJax supports
|
||||||
// https://docs.mathjax.org/en/latest/input/tex/macros/index.html#environments
|
// https://docs.mathjax.org/en/latest/input/tex/macros/index.html#environments
|
||||||
|
if (environmentName === 'tikzcd') {
|
||||||
|
passToMathJax = false
|
||||||
|
}
|
||||||
if (
|
if (
|
||||||
environmentName !== 'math' &&
|
environmentName !== 'math' &&
|
||||||
environmentName !== 'displaymath'
|
environmentName !== 'displaymath'
|
||||||
|
@ -764,17 +768,18 @@ export const atomicDecorations = (options: Options) => {
|
||||||
displayMode = true
|
displayMode = true
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
if (passToMathJax) {
|
||||||
decorations.push(
|
decorations.push(
|
||||||
Decoration.replace({
|
Decoration.replace({
|
||||||
widget: new MathWidget(
|
widget: new MathWidget(
|
||||||
content,
|
content,
|
||||||
displayMode,
|
displayMode,
|
||||||
commandDefinitions
|
commandDefinitions
|
||||||
),
|
),
|
||||||
block: displayMode,
|
block: displayMode,
|
||||||
}).range(ancestorNode.from, ancestorNode.to)
|
}).range(ancestorNode.from, ancestorNode.to)
|
||||||
)
|
)
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue