Replace <tt> with <code>
This commit is contained in:
parent
ad00cb8115
commit
4b11379d00
|
@ -30,7 +30,11 @@ const nodeChildrenToString = (nodeChildren) => {
|
||||||
string += nodeChildren[i].toString();
|
string += nodeChildren[i].toString();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return string;
|
|
||||||
|
// Replace <tt> with <code>
|
||||||
|
return string
|
||||||
|
.replaceAll('<tt>', '<code>')
|
||||||
|
.replaceAll('</tt>', '</code>')
|
||||||
};
|
};
|
||||||
|
|
||||||
const parseXML = (XML) => {
|
const parseXML = (XML) => {
|
||||||
|
@ -45,13 +49,13 @@ const parseXML = (XML) => {
|
||||||
const contentNodes = newsItem.childNodes();
|
const contentNodes = newsItem.childNodes();
|
||||||
const content = converterShowdown.makeMarkdown(
|
const content = converterShowdown.makeMarkdown(
|
||||||
nodeChildrenToString(contentNodes)
|
nodeChildrenToString(contentNodes)
|
||||||
);
|
).trim();
|
||||||
|
|
||||||
const md = `---
|
const md = `---
|
||||||
author: "${author.replace(/"/g, '\\"')}"
|
author: "${author.replace(/"/g, '\\"')}"
|
||||||
date: "${date.replace(/"/g, '\\"')}"
|
date: "${date.replace(/"/g, '\\"')}"
|
||||||
---
|
---
|
||||||
|
|
||||||
${content}`;
|
${content}`;
|
||||||
const mdTitle = `${date}-${author}`;
|
const mdTitle = `${date}-${author}`;
|
||||||
fs.mkdirSync(
|
fs.mkdirSync(
|
||||||
|
|
Loading…
Reference in New Issue