perf(plugin-auto-frontmatter): 优化 matter生成格式

This commit is contained in:
pengzhanbo 2024-03-25 01:05:57 +08:00
parent 3cada0bfd2
commit 5908363aca

View File

@ -59,6 +59,7 @@ export function autoFrontmatterPlugin({
.stringify(data)
.replace(/\n\s{2}/g, '\n')
.replace(/"/g, '')
.replace(/\s+\n/g, '\n')
const newContent = yaml ? `${yaml}---\n${content}` : content
fs.writeFileSync(filepath, newContent, 'utf-8')