1
0
Fork 0
mirror of https://github.com/mozilla/pdf.js.git synced 2025-04-25 17:48:07 +02:00

[api-minor] Change the "dc:creator" Metadata field to an Array

- add scripting support for doc.info.authors
 - doc.info.metadata is the raw string with xml code
This commit is contained in:
Calixte Denizet 2021-01-08 18:40:09 +01:00
parent 35845d1bbb
commit 43d5512f5c
10 changed files with 97 additions and 33 deletions

View file

@ -427,12 +427,13 @@ class SimpleDOMNode {
}
class SimpleXMLParser extends XMLParserBase {
constructor(hasAttributes = false) {
constructor({ hasAttributes = false, lowerCaseName = false }) {
super();
this._currentFragment = null;
this._stack = null;
this._errorCode = XMLParserErrorCode.NoError;
this._hasAttributes = hasAttributes;
this._lowerCaseName = lowerCaseName;
}
parseFromString(data) {
@ -476,6 +477,9 @@ class SimpleXMLParser extends XMLParserBase {
}
onBeginElement(name, attributes, isEmpty) {
if (this._lowerCaseName) {
name = name.toLowerCase();
}
const node = new SimpleDOMNode(name);
node.childNodes = [];
if (this._hasAttributes) {