Commit 80ccb701 authored by Audrey Hamelers's avatar Audrey Hamelers

fiddling with space in XML files

parent 13219f9b
Pipeline #12993 passed with stages
in 5 minutes and 47 seconds
......@@ -168,19 +168,19 @@ async function createMetadataXML(tmpPath, manuscript) {
manuscript['meta,publicationDates'].length > 0
? manuscript['meta,publicationDates']
.map(pDate => {
let dateStr = `<pub-date pub-type="${pDate.type}">\n `
let dateStr = `<pub-date pub-type="${pDate.type}">\n`
if (pDate.jatsDate) {
dateStr += Object.keys(pDate.jatsDate)
.sort()
.map(el =>
pDate.jatsDate[el]
? `<${el}>${pDate.jatsDate[el]}</${el}>\n `
? ` <${el}>${pDate.jatsDate[el]}</${el}>\n`
: '',
)
.join('')
} else {
dateStr += moment(pDate.date).format(
'[<day>]DD[</day>\n <month>]MM[</month>\n <year>]YYYY[</year>]',
'[<day>]DD[</day>\n <month>]MM[</month>\n <year>]YYYY[</year>\n]',
)
}
dateStr += '</pub-date>'
......@@ -197,7 +197,7 @@ async function createMetadataXML(tmpPath, manuscript) {
).created
xml += ` <pub-date pub-type="nihms-submitted">
${moment(submittedDate).format(
'[<day>]DD[</day>\n <month>]MM[</month>\n <year>]YYYY[</year>]',
'[<day>]DD[</day>\n <month>]MM[</month>\n <year>]YYYY[</year>\n]',
)}
</pub-date>\n`
} catch (ignored) {
......
......@@ -34,7 +34,7 @@ async function uploadCitation(_, { manuscriptId }, { user }) {
articleIds.length > 0
? articleIds
.map(
aid => `\n<article-id pub-id-type="${aid.pubIdType}">${
aid => `\n <article-id pub-id-type="${aid.pubIdType}">${
aid.id
}</article-id>
`,
......@@ -46,16 +46,16 @@ async function uploadCitation(_, { manuscriptId }, { user }) {
? publicationDates
.map(pDate =>
pDate.jatsDate
? `<pub-date pub-type="${pDate.type}">\n ${Object.keys(
? `<pub-date pub-type="${pDate.type}">\n${Object.keys(
pDate.jatsDate,
)
.sort()
.map(el =>
pDate.jatsDate[el]
? `<${el}>${pDate.jatsDate[el]}</${el}>\n `
? ` <${el}>${pDate.jatsDate[el]}</${el}>\n`
: '',
)
.join('')}</pub-date>`
.join('')} </pub-date>`
: '',
)
.join('\n ')
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment