Make abstract optional
This commit is contained in:
parent
c6180ae95c
commit
55dc7cfbfa
|
@ -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])
|
||||||
|
|
Loading…
Reference in New Issue