Exit regex matching on unclosed MFM tag
This commit is contained in:
parent
08c65455e5
commit
c748bacc0f
3 changed files with 8 additions and 1 deletions
|
@ -94,6 +94,10 @@
|
|||
var walk = 0;
|
||||
|
||||
while (level > 0 || walk === 0) {
|
||||
if (walk >= src.length) {
|
||||
return null;
|
||||
}
|
||||
|
||||
if (src[walk] + src[walk + 1] === '$[') {
|
||||
level++;
|
||||
walk++;
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
{
|
||||
"name": "marked-mfm",
|
||||
"version": "0.3.1",
|
||||
"version": "0.3.2",
|
||||
"description": "Marked.js extension for Misskey-flavored Markdown",
|
||||
"main": "./src/index.js",
|
||||
"browser": "./lib/index.umd.js",
|
||||
|
|
|
@ -10,6 +10,9 @@ export default {
|
|||
let level = 0
|
||||
let walk = 0
|
||||
while (level > 0 || walk === 0) {
|
||||
if (walk >= src.length) {
|
||||
return null
|
||||
}
|
||||
if (src[walk] + src[walk + 1] === '$[') {
|
||||
level++
|
||||
walk++
|
||||
|
|
Loading…
Reference in a new issue