fix: Remove richtypo on head

This commit is contained in:
Simon 2022-02-01 17:08:50 +01:00
parent ae3473dcea
commit abc114f66a
1 changed files with 4 additions and 1 deletions

View File

@ -27,8 +27,11 @@ const rt = richtypo.default([frRules.default, quotes]);
const folder = path.resolve(process.cwd(), 'public')
loadPages(folder).then(pages => {
const bodyRegex = '<body>(.*)</body>'
const regEx = new RegExp(`${bodyRegex}`, "ig")
for (const page of pages) {
page.content = rt(page.content)
const body = rt(regEx.exec(page.content)[1])
page.content = page.content.replace(bodyRegex, body)
}
savePages(pages);