New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

TEI.js fix unvalid generated xml-ids and imprint #1705

Merged
merged 6 commits into from Aug 7, 2018

Conversation

Projects
None yet
2 participants
@oriflamms
Contributor

oriflamms commented Aug 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

oriflamms and others added some commits Aug 4, 2018

TEI.js Outdated
@@ -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.

@adam3smith

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.

@oriflamms

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 adam3smith merged commit bcb76d9 into zotero:master Aug 7, 2018

1 check passed

continuous-integration/travis-ci/pr The Travis CI build passed
Details
@adam3smith

This comment has been minimized.

Collaborator

adam3smith commented Aug 7, 2018

Thanks -- and sorry about the "or" mixup. !(a||b) is of course !a && !b. Just checking for date should work nicely, though. If people want the empty nodes and/or the comment back we can do so later.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment