markmap-lib
Advanced tools
Comparing version 0.15.6 to 0.15.7
@@ -112,8 +112,8 @@ "use strict"; | ||
const { content } = context; | ||
if (!content.startsWith("---\n")) | ||
if (!/^---\r?\n/.test(content)) | ||
return; | ||
const endOffset = content.indexOf("\n---\n"); | ||
if (endOffset < 0) | ||
const match = /\n---\r?\n/.exec(content); | ||
if (!match) | ||
return; | ||
const raw = content.slice(4, endOffset); | ||
const raw = content.slice(4, match.index); | ||
let frontmatter2; | ||
@@ -131,4 +131,4 @@ try { | ||
context.frontmatter = frontmatter2; | ||
context.content = content.slice(endOffset + 5); | ||
context.contentLineOffset = content.slice(0, endOffset).split("\n").length + 1; | ||
context.content = content.slice(match.index + match[0].length); | ||
context.contentLineOffset = content.slice(0, match.index).split("\n").length + 1; | ||
}); | ||
@@ -135,0 +135,0 @@ return {}; |
{ | ||
"name": "markmap-lib", | ||
"version": "0.15.6", | ||
"version": "0.15.7", | ||
"description": "Visualize your Markdown as mindmaps with Markmap", | ||
@@ -76,3 +76,3 @@ "author": "Gerald <gera2ld@live.com>", | ||
}, | ||
"gitHead": "7309ee74a3fed2c40a2fc37f1b5df208f25f3c3a" | ||
"gitHead": "9d71c074d32c6912591dceb42c4381e27de05fbf" | ||
} |
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
289810