summaryrefslogtreecommitdiff
path: root/lisp/dom.el
diff options
context:
space:
mode:
Diffstat (limited to 'lisp/dom.el')
-rw-r--r--lisp/dom.el24
1 files changed, 15 insertions, 9 deletions
diff --git a/lisp/dom.el b/lisp/dom.el
index eb4603a7f2f..e4da63d8476 100644
--- a/lisp/dom.el
+++ b/lisp/dom.el
@@ -78,15 +78,21 @@ A typical attribute is `href'."
(defun dom-texts (node &optional separator)
"Return all textual data under NODE concatenated with SEPARATOR in-between."
- (mapconcat
- 'identity
- (mapcar
- (lambda (elem)
- (if (stringp elem)
- elem
- (dom-texts elem separator)))
- (dom-children node))
- (or separator " ")))
+ (if (eq (dom-tag node) 'script)
+ ""
+ (mapconcat
+ 'identity
+ (mapcar
+ (lambda (elem)
+ (cond
+ ((stringp elem)
+ elem)
+ ((eq (dom-tag elem) 'script)
+ "")
+ (t
+ (dom-texts elem separator))))
+ (dom-children node))
+ (or separator " "))))
(defun dom-child-by-tag (dom tag)
"Return the first child of DOM that is of type TAG."