summaryrefslogtreecommitdiff
path: root/src/static/js/contentcollector.js
diff options
context:
space:
mode:
authorJohn McLear <john@mclear.co.uk>2014-11-25 17:26:09 +0000
committerJohn McLear <john@mclear.co.uk>2014-11-25 17:26:09 +0000
commit60d44cd3df201088538d561795dee56badbcc6b2 (patch)
treece3f5514e74f6b2fe3aebb153819fe325a5736ae /src/static/js/contentcollector.js
parent97068b562dce9525fda9fb7a08f54faf9ef2837d (diff)
downloadetherpad-lite-60d44cd3df201088538d561795dee56badbcc6b2.zip
use cheerio instead of jsdom
Diffstat (limited to 'src/static/js/contentcollector.js')
-rw-r--r--src/static/js/contentcollector.js5
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)