Replace <tt> with <code>

This commit is contained in:
Aditya Thakral 2021-08-24 16:22:49 -04:00
parent ad00cb8115
commit 4b11379d00
1 changed files with 7 additions and 3 deletions

View File

@ -30,7 +30,11 @@ const nodeChildrenToString = (nodeChildren) => {
string += nodeChildren[i].toString();
}
}
return string;
// Replace <tt> with <code>
return string
.replaceAll('<tt>', '<code>')
.replaceAll('</tt>', '</code>')
};
const parseXML = (XML) => {
@ -45,13 +49,13 @@ const parseXML = (XML) => {
const contentNodes = newsItem.childNodes();
const content = converterShowdown.makeMarkdown(
nodeChildrenToString(contentNodes)
);
).trim();
const md = `---
author: "${author.replace(/"/g, '\\"')}"
date: "${date.replace(/"/g, '\\"')}"
---
${content}`;
const mdTitle = `${date}-${author}`;
fs.mkdirSync(