Exit regex matching on unclosed MFM tag

This commit is contained in:
Sol Fisher Romanoff 2022-07-10 22:30:53 +03:00
parent 08c65455e5
commit c748bacc0f
No known key found for this signature in database
GPG key ID: 9D3F2B64F2341B62
3 changed files with 8 additions and 1 deletions

View file

@ -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++;

View file

@ -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",

View file

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