fix off-by-one error in isolating raw frontmatter
This commit is contained in:
+1
-1
@@ -42,7 +42,7 @@ export default function gemtext(config: GemtextConfig = {}): AstroIntegration {
|
|||||||
|
|
||||||
if (lines.at(0) === '---' && lines.lastIndexOf('---') > 0) {
|
if (lines.at(0) === '---' && lines.lastIndexOf('---') > 0) {
|
||||||
bodyStartLineIndex = lines.indexOf('---', 1) + 1;
|
bodyStartLineIndex = lines.indexOf('---', 1) + 1;
|
||||||
frontmatter = lines.slice(1, bodyStartLineIndex).join('\n');
|
frontmatter = lines.slice(1, bodyStartLineIndex - 1).join('\n');
|
||||||
try {
|
try {
|
||||||
data = { ...data, ...parseYaml(frontmatter, { schema: 'yaml-1.1' }) };
|
data = { ...data, ...parseYaml(frontmatter, { schema: 'yaml-1.1' }) };
|
||||||
} catch { }
|
} catch { }
|
||||||
|
|||||||
Reference in New Issue
Block a user