AdamNiederer / elquery

Read and manipulate HTML in emacs
GNU General Public License v3.0
42 stars 5 forks source link

Error when parsing multiple attributes #3

Closed grimnebulin closed 7 years ago

grimnebulin commented 7 years ago

If I run (elquery-read-file "test.html") when test.html contains the text:

<p x="x" y="y">

...then I get an error:

Debugger entered--Lisp error: (wrong-type-argument listp "x")
  append((:x . "x") (:y) "y")
  (setq acc (append acc (list (elquery--to-kw (car it))) (cdr it)))
  (let ((it (car list))) (setq acc (append acc (list (elquery--to-kw (car it))) (cdr it))))
  (while list (let ((it (car list))) (setq acc (append acc (list (elquery--to-kw (car it))) (cdr it)))) (setq it-index (1+ it-index)) (setq list (cdr list)))
  (let ((list (cdr list-value)) (it-index 0)) (while list (let ((it (car list))) (setq acc (append acc (list (elquery--to-kw (car it))) (cdr it)))) (setq it-index (1+ it-index)) (setq list (cdr list))))
  (let ((acc (car list-value))) (let ((list (cdr list-value)) (it-index 0)) (while list (let ((it (car list))) (setq acc (append acc (list (elquery--to-kw ...)) (cdr it)))) (setq it-index (1+ it-index)) (setq list (cdr list)))) acc)
  (if list-value (let ((acc (car list-value))) (let ((list (cdr list-value)) (it-index 0)) (while list (let ((it (car list))) (setq acc (append acc (list ...) (cdr it)))) (setq it-index (1+ it-index)) (setq list (cdr list)))) acc) (let (acc it) (append acc (list (elquery--to-kw (car it))) (cdr it))))
  (let ((list-value (cons (quote nil) list))) (if list-value (let ((acc (car list-value))) (let ((list (cdr list-value)) (it-index 0)) (while list (let ((it ...)) (setq acc (append acc ... ...))) (setq it-index (1+ it-index)) (setq list (cdr list)))) acc) (let (acc it) (append acc (list (elquery--to-kw (car it))) (cdr it)))))
  elquery--alist-to-plist(((x . "x") (y . "y")))

(many more stack frames elided)

If the p tag has only the attribute x or y, the parse succeeds.

AdamNiederer commented 7 years ago

Fixed in 13e88d46