Parcourir la source

Merge pull request #19137 from overleaf/em-mj-parbox

Add special parsing for \parbox

GitOrigin-RevId: a69a519fa75af95712e19426265224507400f105
Eric Mc Sween il y a 2 ans
Parent
commit
f0c67b45c7

+ 8 - 1
services/web/frontend/js/features/source-editor/lezer-latex/latex.grammar

@@ -93,7 +93,8 @@
     TopRuleCtrlSeq,
     MidRuleCtrlSeq,
     BottomRuleCtrlSeq,
-    MultiColumnCtrlSeq
+    MultiColumnCtrlSeq,
+    ParBoxCtrlSeq
 }
 
 @external specialize {EnvName} specializeEnvName from "./tokens.mjs" {
@@ -347,6 +348,12 @@ KnownCommand<ArgumentType> {
     } |
     MathTextCommand {
         MathTextCtrlSeq optionalWhitespace? "*"? TextArgument
+    } |
+    ParBoxCommand {
+        ParBoxCtrlSeq
+            (optionalWhitespace? OptionalArgument)*
+            ShortTextArgument
+            optionalWhitespace? TextArgument
     }
 }
 

+ 2 - 0
services/web/frontend/js/features/source-editor/lezer-latex/tokens.mjs

@@ -79,6 +79,7 @@ import {
   BottomRuleCtrlSeq,
   TableEnvName,
   MultiColumnCtrlSeq,
+  ParBoxCtrlSeq,
   // Marker for end of argument lists
   endOfArguments,
   hasMoreArguments,
@@ -575,6 +576,7 @@ const otherKnowncommands = {
   '\\midrule': MidRuleCtrlSeq,
   '\\bottomrule': BottomRuleCtrlSeq,
   '\\multicolumn': MultiColumnCtrlSeq,
+  '\\parbox': ParBoxCtrlSeq,
 }
 // specializer for control sequences
 // return new tokens for specific control sequences