From 2160b6147b48ac41bc1ac8a4afc4d6f9aaacbc12 Mon Sep 17 00:00:00 2001 From: marihachi <marihachi0620@gmail.com> Date: Mon, 24 Feb 2020 22:55:59 +0900 Subject: [PATCH] implement syntax: mathBlock --- src/parser/core-parser.pegjs | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/src/parser/core-parser.pegjs b/src/parser/core-parser.pegjs index 927e530..b22d832 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 -- GitLab