summaryrefslogtreecommitdiff
path: root/lisp/dom.el
diff options
context:
space:
mode:
authorLars Magne Ingebrigtsen <larsi@gnus.org>2015-01-16 03:08:55 +0100
committerLars Magne Ingebrigtsen <larsi@gnus.org>2015-01-16 03:08:55 +0100
commitb6b9d465cb81f5d35fb5c5432461ce7170759725 (patch)
treebb38ba7cfee6b92e90453c8a85615fdeaf0f35a9 /lisp/dom.el
parent22294ae511509ad86586eb5d054c95de38e87894 (diff)
downloademacs-b6b9d465cb81f5d35fb5c5432461ce7170759725.tar.gz
* lisp/dom.el (dom-strings): New function.
Diffstat (limited to 'lisp/dom.el')
-rw-r--r--lisp/dom.el8
1 files changed, 8 insertions, 0 deletions
diff --git a/lisp/dom.el b/lisp/dom.el
index 527b8e61f2e..11357e88804 100644
--- a/lisp/dom.el
+++ b/lisp/dom.el
@@ -103,6 +103,14 @@ A name is a symbol like `td'."
(cons dom matches)
matches)))
+(defun dom-strings (dom)
+ "Return elements in DOM that are strings."
+ (cl-loop for child in (dom-children dom)
+ if (stringp child)
+ collect child
+ else
+ append (dom-strings child)))
+
(defun dom-by-class (dom match)
"Return elements in DOM that have a class name that matches regexp MATCH."
(dom-elements dom 'class match))