* lisp/dom.el (dom-strings): New function.

parent 22294ae5
......@@ -4507,6 +4507,9 @@ which is a regular expression.
Return all nodes in @var{dom} that have IDs that match @var{match},
which is a regular expression.
@item dom-strings @var{dom}
Return all strings in @var{DOM}.
@end table
Utility functions:
......
2015-01-16 Lars Magne Ingebrigtsen <larsi@gnus.org>
* dom.el (dom-strings): New function.
* files.el (directory-files-recursively): Don't use the word
"path" for a file name.
......
......@@ -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))
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment