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 <ttakah@gmail.com>
This commit is contained in:
TAKAHASHI Tamotsu 2020-09-25 12:21:00 +09:00 committed by Tamotsu Takahashi
parent cebd5e7da9
commit ac43db80de

View File

@ -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 {