[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
html-parse-string: Ignores the content of SCRIPT tag and the COMMENT tag
From: |
HAMANO Kiyoto |
Subject: |
html-parse-string: Ignores the content of SCRIPT tag and the COMMENT tag |
Date: |
Tue, 21 Sep 2010 00:38:30 +0900 |
;; I reported this in 9/13, But there is no reaction. So, I resends.
Hi, Emacs developers.
The html-parse-string ignores the content of script tag and the
comment tag.
[Reproduce]
Evaluate each following codes.
;; case A.
(insert (format "%S" (html-parse-string "<script>foo</script>")))
;; case B.
(insert (format "%S" (html-parse-string "<p>foo</p><!-- comment -->")))
;; case C.
(insert (format "%S" (html-parse-string "<!-- comment -->")))
[Result]
The comment is result.
;; case A.
(insert (format "%S" (html-parse-string "<script>foo</script>")))
;; => (html (head (script nil)))
;; case B.
(insert (format "%S" (html-parse-string "<p>foo</p><!-- comment -->")))
;; => (html (body (p (text . "foo")) nil))
;; case C.
(insert (format "%S" (html-parse-string "<!-- comment -->")))
;; => 34520726 (#o203537226, #x20ebe96)
[Expceted result]
For example, I expect like the following result.
The comment is expected result.
;; case A.
(insert (format "%S" (html-parse-string "<script>foo</script>")))
;; => (html (head (script (cdata . "foo"))))
;; case B.
(insert (format "%S" (html-parse-string "<p>foo</p><!-- comment -->")))
;; => (html (body (p (text . "foo")) (comment . " comment ")))
;; case C.
(insert (format "%S" (html-parse-string "<!-- comment -->")))
;; => (comment . " comment ")
[Patch]
As a sample, I attach the patch which I made.
;; My envrionment:
$ emacs --version
GNU Emacs 24.0.50.2
$ uname -a
Linux debian 2.6.35-trunk-686 #1 SMP Mon Sep 6 17:54:16 UTC 2010 i686 GNU/Linux
$ LANG=c apt-cache policy libxml2
libxml2:
Installed: 2.7.7.dfsg-4
Candidate: 2.7.7.dfsg-4
Version table:
*** 2.7.7.dfsg-4 0
500 http://ftp.jaist.ac.jp sid/main Packages
100 /var/lib/dpkg/status
Thanks.
--
HAMANO Kiyoto
address@hidden
xml.c.patch
Description: Text Data
- html-parse-string: Ignores the content of SCRIPT tag and the COMMENT tag,
HAMANO Kiyoto <=