mirror of
https://github.com/yu-i-i/overleaf-cep.git
synced 2026-06-10 06:39:01 +02:00
Merge pull request #21535 from overleaf/ae-grammar-grouping
* Move $MathContainer grouping into the LaTeX grammar * Remove $Environment grouping from NodeProp.group GitOrigin-RevId: 96c74edd818bf84acf4b492702864c3c71a9bee3
This commit is contained in:
@@ -163,17 +163,8 @@ export const LaTeXLanguage = LRLanguage.define({
|
||||
) {
|
||||
types.push('$TextArgument')
|
||||
}
|
||||
} else if (
|
||||
type.name.endsWith('Environment') &&
|
||||
!['NewEnvironment', 'RenewEnvironment'].includes(type.name)
|
||||
) {
|
||||
types.push('$Environment')
|
||||
} else if (type.name.endsWith('Brace')) {
|
||||
types.push('$Brace')
|
||||
} else if (
|
||||
['BracketMath', 'ParenMath', 'DollarMath'].includes(type.name)
|
||||
) {
|
||||
types.push('$MathContainer')
|
||||
}
|
||||
|
||||
if (type.name in typeMap) {
|
||||
|
||||
@@ -692,7 +692,7 @@ NonEmptyGroup<GroupContent> {
|
||||
|
||||
/// MATH MODE
|
||||
|
||||
DollarMath {
|
||||
DollarMath[@isGroup="$MathContainer"] {
|
||||
Dollar (InlineMath | DisplayMath) Dollar
|
||||
}
|
||||
|
||||
@@ -714,7 +714,7 @@ CloseParenMath[openedBy=OpenParenMath] {
|
||||
}
|
||||
|
||||
// alternative syntax \( math \) for inline math, it is the same as $ math $
|
||||
ParenMath {
|
||||
ParenMath[@isGroup="$MathContainer"] {
|
||||
OpenParenMath
|
||||
Math?
|
||||
CloseParenMath
|
||||
@@ -729,7 +729,7 @@ CloseBracketMath[openedBy=OpenBracketMath] {
|
||||
}
|
||||
|
||||
// alternative syntax \[ math \] for display math, it is the same as $$ math $$
|
||||
BracketMath {
|
||||
BracketMath[@isGroup="$MathContainer"] {
|
||||
OpenBracketMath
|
||||
Math?
|
||||
CloseBracketMath
|
||||
|
||||
Reference in New Issue
Block a user