diff --git a/src/parser/core-parser.pegjs b/src/parser/core-parser.pegjs index 927e5304cea848fc002eb33f7cc1ab3165b83739..b22d832f631dd3b40534c218d273f3cdbe4819ef 100644 --- a/src/parser/core-parser.pegjs +++ b/src/parser/core-parser.pegjs @@ -24,7 +24,7 @@ block / quote / search / blockCode - // / mathBlock + / mathBlock / center inline @@ -114,6 +114,17 @@ blockCode_line = !("```" ENDLINE) line:$(CHAR+) NEWLINE { return line; } +// block: mathBlock + +mathBlock + = BEGINLINE "\\[" content:$(!"\\]" c:. { return c; })+ "\\]" ENDLINE +{ + return createTree('mathBlock', { + formula: content.trim() + }); +} + + // block: center center