diff --git a/packages/epub-utils/package.json b/packages/epub-utils/package.json index 4cf40685..79156eec 100644 --- a/packages/epub-utils/package.json +++ b/packages/epub-utils/package.json @@ -21,7 +21,7 @@ "fs-extra": "^6.0.1", "tmp": "^0.0.33", "winston": "^2.4.0", - "xmldom-alpha": "https://github.com/fchasen/xmldom.git#a38f7ddb536ab74e9fb549477ba9f9b7ea2d0beb", + "xmldom-alpha": "^0.1.28", "xpath": "^0.0.24" }, "publishConfig": { diff --git a/packages/epub-utils/src/epub-parse.js b/packages/epub-utils/src/epub-parse.js index 6686ac23..bbd2b9ee 100644 --- a/packages/epub-utils/src/epub-parse.js +++ b/packages/epub-utils/src/epub-parse.js @@ -40,7 +40,8 @@ function EpubParser() { function parseNavDoc(fullpath, epubDir) { const content = fs.readFileSync(fullpath).toString(); - const doc = new DOMParser({errorHandler}).parseFromString(content, 'application/xhtml+xml'); + //FIXME hack to workaround xmldom-alpha regex test + const doc = new DOMParser({errorHandler}).parseFromString(content, 'application/xhtml'); // Remove all links const aElems = doc.getElementsByTagNameNS('http://www.w3.org/1999/xhtml', 'a'); @@ -175,7 +176,8 @@ EpubParser.prototype.parseData = function(packageDocPath, epubDir) { EpubParser.prototype.parseContentDocTitle = function(filepath) { const content = fs.readFileSync(filepath).toString(); - const doc = new DOMParser({errorHandler}).parseFromString(content, 'application/xhtml+xml'); + //FIXME hack to workaround xmldom-alpha regex test + const doc = new DOMParser({errorHandler}).parseFromString(content, 'application/xhtml'); const select = xpath.useNamespaces({html: "http://www.w3.org/1999/xhtml", epub: "http://www.idpf.org/2007/ops"}); const title = select('//html:title/text()', doc); if (title.length > 0) { diff --git a/yarn.lock b/yarn.lock index c5d87923..5f6a9732 100644 --- a/yarn.lock +++ b/yarn.lock @@ -6080,9 +6080,9 @@ xmlbuilder@~9.0.1: version "9.0.7" resolved "https://registry.yarnpkg.com/xmlbuilder/-/xmlbuilder-9.0.7.tgz#132ee63d2ec5565c557e20f4c22df9aca686b10d" -"xmldom-alpha@https://github.com/fchasen/xmldom.git#a38f7ddb536ab74e9fb549477ba9f9b7ea2d0beb": +xmldom-alpha@^0.1.28: version "0.1.28" - resolved "https://github.com/fchasen/xmldom.git#a38f7ddb536ab74e9fb549477ba9f9b7ea2d0beb" + resolved "https://registry.yarnpkg.com/xmldom-alpha/-/xmldom-alpha-0.1.28.tgz#4e8451d8df4d7bb303baae0bde783062f9d3d600" xpath@^0.0.24: version "0.0.24"