me
/
guix
Archived
1
0
Fork 0

gnu: netsurf: Fix entity parsing.

Follow-up to commit 31afa654c5.

* gnu/packages/web.scm (netsurf)[arguments]: In 'adjust-welcome' phase, ensure
html entities are parsed and find their way back to the output.

Signed-off-by: Tobias Geerinckx-Rice <me@tobias.gr>
master
Eric Bavier 2020-02-03 23:06:09 -06:00 committed by Tobias Geerinckx-Rice
parent 52e7bcfd89
commit f1452776ac
No known key found for this signature in database
GPG Key ID: 0DB0FF884F556D79
1 changed files with 9 additions and 2 deletions

View File

@ -6,7 +6,7 @@
;;; Copyright © 2015, 2016, 2017, 2018, 2019 Ricardo Wurmus <rekado@elephly.net> ;;; Copyright © 2015, 2016, 2017, 2018, 2019 Ricardo Wurmus <rekado@elephly.net>
;;; Copyright © 2018 Raoul Jean Pierre Bonnal <ilpuccio.febo@gmail.com> ;;; Copyright © 2018 Raoul Jean Pierre Bonnal <ilpuccio.febo@gmail.com>
;;; Copyright © 2015 Taylan Ulrich Bayırlı/Kammer <taylanbayirli@gmail.com> ;;; Copyright © 2015 Taylan Ulrich Bayırlı/Kammer <taylanbayirli@gmail.com>
;;; Copyright © 2015, 2016, 2017, 2018, 2019 Eric Bavier <bavier@member.fsf.org> ;;; Copyright © 2015, 2016, 2017, 2018, 2019, 2020 Eric Bavier <bavier@posteo.net>
;;; Copyright © 2015 Eric Dvorsak <eric@dvorsak.fr> ;;; Copyright © 2015 Eric Dvorsak <eric@dvorsak.fr>
;;; Copyright © 2016 Sou Bunnbu <iyzsong@gmail.com> ;;; Copyright © 2016 Sou Bunnbu <iyzsong@gmail.com>
;;; Copyright © 2016 Jelle Licht <jlicht@fsfe.org> ;;; Copyright © 2016 Jelle Licht <jlicht@fsfe.org>
@ -5075,12 +5075,19 @@ w3c webidl files and a binding configuration file.")
;; Leave the DOCTYPE header as is. ;; Leave the DOCTYPE header as is.
(display (read-line in 'concat) out) (display (read-line in 'concat) out)
(sxml->xml (sxml->xml
(let rec ((sxml (xml->sxml in))) (let rec ((sxml (xml->sxml in
#:default-entity-handler
(lambda (port name)
(string-append "<ENTITY>"
(symbol->string name)
"</ENTITY>")))))
;; We'd like to use sxml-match here, but it can't ;; We'd like to use sxml-match here, but it can't
;; match against generic tag symbols... ;; match against generic tag symbols...
(match sxml (match sxml
(`(div (@ (class "links")) . ,rest) (`(div (@ (class "links")) . ,rest)
'()) '())
(`(ENTITY ,ent)
`(*ENTITY* ,ent))
((x ...) ((x ...)
(map rec x)) (map rec x))
(x x))) (x x)))