From ac43db80ded4ec4026ce1a992a6302dcc1553a24 Mon Sep 17 00:00:00 2001 From: TAKAHASHI Tamotsu Date: Fri, 25 Sep 2020 12:21:00 +0900 Subject: [PATCH] Fix matchInContainer false positives The function should match only the beginnings of lines. For example, see this testcase: ``` :::spoiler here is a ::: ::: ::: ``` The last line should be completed. Without this patch, the third line is completed and the last is not. Signed-off-by: Tamotsu Takahashi --- public/js/index.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/public/js/index.js b/public/js/index.js index c736cb7f..9f2421cc 100644 --- a/public/js/index.js +++ b/public/js/index.js @@ -3137,7 +3137,7 @@ function checkInContainerSyntax () { function matchInContainer (text) { var match - match = text.match(/:{3,}/g) + match = text.match(/(^|\n):::/gm) if (match && match.length % 2) { return true } else {