1
0
mirror of https://git.savannah.gnu.org/git/emacs.git synced 2024-11-26 07:33:47 +00:00

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

This commit is contained in:
Lars Magne Ingebrigtsen 2015-01-16 03:08:55 +01:00
parent 22294ae511
commit b6b9d465cb
3 changed files with 13 additions and 0 deletions

View File

@ -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:

View File

@ -1,5 +1,7 @@
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.

View File

@ -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))