Fix decoded ampersands

This commit is contained in:
Vamsi Krishna 2021-06-28 22:05:49 +05:30 committed by GitHub
parent 56a47f9e9e
commit 2d37e8546e
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -86,6 +86,9 @@ fs.readdir(inputDirectory, (err, items) => {
cleanData = cleanData.replace(/\[\[(.*)\]\]/g, (match, p1) => {
return `[${p1}](${url(p1)})`;
});
// Replace decoded & -> &
cleanData = cleanData.replace(/&/g, "&");
// Create the new markdown header for Hugo.
const newFileContents = `+++\r\ntitle = "${title}"\r\ndate = "${modified.toISOString()}"\r\n+++\r\n\r\n${cleanData}\r\n`;