diff options
author | John McLear <john@mclear.co.uk> | 2014-11-25 17:26:09 +0000 |
---|---|---|
committer | John McLear <john@mclear.co.uk> | 2014-11-25 17:26:09 +0000 |
commit | 60d44cd3df201088538d561795dee56badbcc6b2 (patch) | |
tree | ce3f5514e74f6b2fe3aebb153819fe325a5736ae /src/static/js/contentcollector.js | |
parent | 97068b562dce9525fda9fb7a08f54faf9ef2837d (diff) | |
download | etherpad-lite-60d44cd3df201088538d561795dee56badbcc6b2.zip |
use cheerio instead of jsdom
Diffstat (limited to 'src/static/js/contentcollector.js')
-rw-r--r-- | src/static/js/contentcollector.js | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/src/static/js/contentcollector.js b/src/static/js/contentcollector.js index 5e393670..048ed491 100644 --- a/src/static/js/contentcollector.js +++ b/src/static/js/contentcollector.js @@ -54,10 +54,14 @@ function makeContentCollector(collectStyles, browser, apool, domInterface, class }, nodeNumChildren: function(n) { + if(n.childNodes == null) return 0; return n.childNodes.length; }, nodeChild: function(n, i) { + if(n.childNodes.item == null){ + return n.childNodes[i]; + } return n.childNodes.item(i); }, nodeProp: function(n, p) @@ -66,6 +70,7 @@ function makeContentCollector(collectStyles, browser, apool, domInterface, class }, nodeAttr: function(n, a) { + if(n.getAttribute == null) return null; return n.getAttribute(a); }, optNodeInnerHTML: function(n) |