Replace <tt> with <code>
This commit is contained in:
parent
ad00cb8115
commit
4b11379d00
|
@ -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(
|
||||
|
|
Loading…
Reference in New Issue