Make abstract optional

This commit is contained in:
Jared He 2021-06-14 00:00:44 -05:00
parent c6180ae95c
commit 55dc7cfbfa
1 changed files with 2 additions and 2 deletions

View File

@ -7,7 +7,7 @@ var showdown = require("showdown");
const converterShowdown = new showdown.Converter(); const converterShowdown = new showdown.Converter();
const xmlJs = require("xml-js"); const xmlJs = require("xml-js");
fs.readFile("./events-test.xml", "utf8", (err, data) => { fs.readFile("./events.xml", "utf8", (err, data) => {
if (err) { if (err) {
console.error(err); console.error(err);
return; return;
@ -70,7 +70,7 @@ const parseXML = (XML) => {
const online = location.toLowerCase() === "online" ? true : false; const online = location.toLowerCase() === "online" ? true : false;
let abstract = "undefined"; let abstract = "undefined";
if (js.elements[0].elements[i].elements[1] === undefined) { if (js.elements[0].elements[i].elements[1] === undefined) {
console.error(`${title}, ${currentTerm} has no abstract`); abstract = short;
} else { } else {
abstract = converterShowdown.makeMarkdown( abstract = converterShowdown.makeMarkdown(
xmlJs.js2xml(js.elements[0].elements[i].elements[1]) xmlJs.js2xml(js.elements[0].elements[i].elements[1])