haunt-customize-read-html-post.patch 797 B

12345678910111213141516171819202122
  1. --- a/haunt/reader.scm 2020-08-06 11:56:32.209142957 +0300
  2. +++ b/haunt/reader.scm 2020-08-06 11:56:42.337301686 +0300
  3. @@ -103,10 +103,15 @@
  4. (values (alist-delete 'content contents eq?)
  5. (assq-ref contents 'content))))))
  6. -(define (read-html-post port)
  7. +(define (read-html-post-prime port)
  8. (values (read-metadata-headers port)
  9. - (match (xml->sxml port)
  10. - (('*TOP* sxml) sxml))))
  11. + (let loop ((ret '()))
  12. + (catch 'parser-error
  13. + (lambda ()
  14. + (match (xml->sxml port)
  15. + (('*TOP* sxml) (loop (cons sxml ret)))))
  16. + (lambda (key . parameters)
  17. + (reverse ret))))))
  18. (define html-reader
  19. (make-reader (make-file-extension-matcher "html")