mirror of
https://github.com/status-im/codimd.git
synced 2025-01-13 07:04:13 +00:00
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:
parent
cebd5e7da9
commit
ac43db80de
@ -3137,7 +3137,7 @@ function checkInContainerSyntax () {
|
|||||||
|
|
||||||
function matchInContainer (text) {
|
function matchInContainer (text) {
|
||||||
var match
|
var match
|
||||||
match = text.match(/:{3,}/g)
|
match = text.match(/(^|\n):::/gm)
|
||||||
if (match && match.length % 2) {
|
if (match && match.length % 2) {
|
||||||
return true
|
return true
|
||||||
} else {
|
} else {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user