Skip to content

Commit

Permalink
fix: ignore empty string
Browse files Browse the repository at this point in the history
  • Loading branch information
benjycui committed Apr 6, 2016
1 parent c146747 commit 24f5ce7
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion lib/dom.js
Original file line number Diff line number Diff line change
Expand Up @@ -142,7 +142,7 @@ var fromHTML = exports.fromHTML = function(elem, filter) {
var str = String(elem.nodeValue);
// free references
elem = null;
return str;
return /^(\n|\s)+$/.test(str) ? null : str;
case 10: // doctype
jml = ['!'];

Expand Down

0 comments on commit 24f5ce7

Please sign in to comment.