Support for meta elements in metadata (EPUB 3)
http://www.idpf.org/epub/30/spec/epub30-publications.html#sec-meta-elem A bit more liberal than what’s in the spec to account for non-compliant EPUBs found in the wild.
This commit is contained in:
parent
39d335679c
commit
12b38e31ef
12
epub.js
12
epub.js
@ -361,6 +361,18 @@ EPub.prototype.parseMetadata = function (metadata) {
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
var metas = metadata['meta'] || {};
|
||||
Object.keys(metas).forEach(function(key) {
|
||||
var meta = metas[key];
|
||||
if (meta['@'] && meta['@'].name) {
|
||||
var name = meta['@'].name;
|
||||
this.metadata[name] = meta['@'].content;
|
||||
}
|
||||
if (meta['#'] && meta['@'].property) {
|
||||
this.metadata[meta['@'].property] = meta['#'];
|
||||
}
|
||||
}, this);
|
||||
};
|
||||
|
||||
/**
|
||||
|
Reference in New Issue
Block a user