Join GitHub today
GitHub is home to over 28 million developers working together to host and review code, manage projects, and build software together.
Sign upTEI.js fix unvalid generated xml-ids and imprint #1705
Conversation
oriflamms
and others
added some commits
Aug 4, 2018
@@ -446,10 +451,14 @@ function generateItem(item, teiDoc) { | ||
imprint.appendChild(imprintDate); | ||
} | ||
// flag unpublished if there is no date | publisher | place | ||
// flag unpublished if there is no date | publisher | place by creating empty elements date | publisher | pubPlace |
This comment has been minimized.
This comment has been minimized.
adam3smith
Aug 5, 2018
Collaborator
this doesn't work as is: it creates an empty node for all three if any one of them doesn't exist. Why not instead just tag this on as else
conditions individually for if (item.date)
etc.?
This comment has been minimized.
This comment has been minimized.
oriflamms
Aug 5, 2018
Contributor
As a matter of fact, it did not work that way and in the previous code neither (while the pipes should have said OR, it was correct for all items with at least one of the field). Following your proposition and given that only one field is needed, I've added "!(item.date)" => empty date element.
And I've added some lines to keep the website title (webpage as analytic
oriflamms
and others
added some commits
Aug 5, 2018
adam3smith
merged commit bcb76d9
into
zotero:master
Aug 7, 2018
1 check passed
This comment has been minimized.
This comment has been minimized.
Thanks -- and sorry about the "or" mixup. |
oriflamms commentedAug 4, 2018
TEI.js fix invalid generated xml-ids by replacing invalid characters by underscore and creates empty , and elements if there is no info