Correct frontmatter length measurement (#18453)

This commit is contained in:
Seiya authored and GitHub committed 2025-12-09 23:22:42 +08:00
1 parent a9c0ce927b
commit f2cfef1ec2
6 files changed
+84 -1

No files matched your search

+4 -1
View File
@@ -106,7 +106,10 @@ function parse(text) {
frontMatter,
get content() {
const { raw } = frontMatter;
return raw.replaceAll(/[^\n]/gu, " ") + text.slice(raw.length);
return (
// eslint-disable-next-line require-unicode-regexp -- string length matters so intentionally not using unicode flag
raw.replaceAll(/[^\n]/g, " ") + text.slice(raw.length)
);
},
};
}