Skip to content

Commit

Permalink
fix: revert to the official xmldom-alpha depdency
Browse files Browse the repository at this point in the history
Using a github dependency requires the usage: git [--version] [--help] [-C <path>] [-c name=value]
           [--exec-path[=<path>]] [--html-path] [--man-path] [--info-path]
           [-p | --paginate | --no-pager] [--no-replace-objects] [--bare]
           [--git-dir=<path>] [--work-tree=<path>] [--namespace=<name>]
           <command> [<args>]

These are common Git commands used in various situations:

start a working area (see also: git help tutorial)
   clone      Clone a repository into a new directory
   init       Create an empty Git repository or reinitialize an existing one

work on the current change (see also: git help everyday)
   add        Add file contents to the index
   mv         Move or rename a file, a directory, or a symlink
   reset      Reset current HEAD to the specified state
   rm         Remove files from the working tree and from the index

examine the history and state (see also: git help revisions)
   bisect     Use binary search to find the commit that introduced a bug
   grep       Print lines matching a pattern
   log        Show commit logs
   show       Show various types of objects
   status     Show the working tree status

grow, mark and tweak your common history
   branch     List, create, or delete branches
   checkout   Switch branches or restore working tree files
   commit     Record changes to the repository
   diff       Show changes between commits, commit and working tree, etc
   merge      Join two or more development histories together
   rebase     Reapply commits on top of another base tip
   tag        Create, list, delete or verify a tag object signed with GPG

collaborate (see also: git help workflows)
   fetch      Download objects and refs from another repository
   pull       Fetch from and integrate with another repository or a local branch
   push       Update remote refs along with associated objects

'git help -a' and 'git help -g' list available subcommands and some
concept guides. See 'git help <command>' or 'git help <concept>'
to read about a specific subcommand or concept. command to be available
at install time. We therefore rever to the xmldom-alpha version in
the npm repository, and add a mimetype hack for xmldom to detect the
content as XHTML
  • Loading branch information
rdeltour committed May 25, 2018
1 parent f444a6e commit c2eafb5
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 5 deletions.
2 changes: 1 addition & 1 deletion packages/epub-utils/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -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": {
Expand Down
6 changes: 4 additions & 2 deletions packages/epub-utils/src/epub-parse.js
Original file line number Diff line number Diff line change
Expand Up @@ -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');
Expand Down Expand Up @@ -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) {
Expand Down
4 changes: 2 additions & 2 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down

0 comments on commit c2eafb5

Please sign in to comment.