support isbn tags in dc:source

This commit is contained in:
Toni Barth 2026-02-08 03:48:22 +01:00
parent 52a0b61b97
commit 989255e957
2 changed files with 15 additions and 1 deletions

View file

@ -65,7 +65,8 @@ function parseIdentifier(metaTags, identifierType) {
const identifierValues = [
...getValues(metaTags, 'dc:identifier'),
...getValues(metaTags, 'ncc:identifier')
...getValues(metaTags, 'ncc:identifier'),
...(identifierType === 'isbn' ? getValues(metaTags, 'dc:source') : [])
]
for (const identifier of identifierValues) {
if (identifierType === 'isbn' && /isbn/i.test(identifier)) {

View file

@ -52,6 +52,19 @@ describe('parseDaisyMetadata', () => {
expect(result.title).to.equal('Title From Head')
})
it('parses isbn from dc:source in DAISY ncc.html', () => {
const nccHtml = `
<html>
<head>
<meta name="dc:source" content="ISBN 978-0-553-38016-3">
</head>
</html>
`
const result = parseDaisyMetadata(nccHtml)
expect(result.isbn).to.equal('978-0-553-38016-3')
})
it('parses chapter names from heading entries in ncc.html', () => {
const nccHtml = `
<html>