diff options
author | Ulf Jasper <ulf.jasper@web.de> | 2014-11-21 16:31:30 +0100 |
---|---|---|
committer | Ulf Jasper <ulf.jasper@web.de> | 2014-11-21 16:31:30 +0100 |
commit | c39443c1d651bab2eb023f4c38db418c3dc04160 (patch) | |
tree | 6266035bf6e6f261440caa4bf5a6d3aafcc43b10 /doc/lispref/text.texi | |
parent | e14c4354cf29fab12fb414c7ebc94bf1a9920dd0 (diff) | |
download | emacs-c39443c1d651bab2eb023f4c38db418c3dc04160.tar.gz |
'libxml-parse(html|xml)-region': new optional param 'discard-comments'.
* doc/lispref/text.texi (Parsing HTML/XML): Document new optional parameter
'discard-comments' of 'libxml-parse(html|xml)-region'.
* src/xml.c (parse_region): Take care of new optional parameter
'discard-comments' of 'libxml-parse(html|xml)-region'.
(Flibxml_parse_html_region, Flibxml_parse_xml_region): New
optional parameter 'discard-comments'.
* test/automated/libxml-tests.el
(libxml-tests--data-comments-preserved): Renamed from
'libxml-tests--data'.
(libxml-tests--data-comments-discarded): New.
(libxml-tests): Check whether 'libxml-parse-xml-region' is
discarding comments correctly.
Diffstat (limited to 'doc/lispref/text.texi')
-rw-r--r-- | doc/lispref/text.texi | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/doc/lispref/text.texi b/doc/lispref/text.texi index d1a1e6fa6b9..7c88a5b25d1 100644 --- a/doc/lispref/text.texi +++ b/doc/lispref/text.texi @@ -4324,7 +4324,7 @@ coding instead. When Emacs is compiled with libxml2 support, the following functions are available to parse HTML or XML text into Lisp object trees. -@defun libxml-parse-html-region start end &optional base-url +@defun libxml-parse-html-region start end &optional base-url discard-comments This function parses the text between @var{start} and @var{end} as HTML, and returns a list representing the HTML @dfn{parse tree}. It attempts to handle ``real world'' HTML by robustly coping with syntax @@ -4333,6 +4333,9 @@ mistakes. The optional argument @var{base-url}, if non-@code{nil}, should be a string specifying the base URL for relative URLs occurring in links. +If the optional argument @var{discard-comments} is non-@code{nil}, +then the parse tree is created without any comments. + In the parse tree, each HTML node is represented by a list in which the first element is a symbol representing the node name, the second element is an alist of node attributes, and the remaining elements are @@ -4368,7 +4371,7 @@ buffer. The argument @var{dom} should be a list as generated by @end defun @cindex parsing xml -@defun libxml-parse-xml-region start end &optional base-url +@defun libxml-parse-xml-region start end &optional base-url discard-comments This function is the same as @code{libxml-parse-html-region}, except that it parses the text as XML rather than HTML (so it is stricter about syntax). |