Sanitize html, fix linking racket-kwargs.

This commit is contained in:
Dominik Pantůček 2023-06-19 14:16:01 +02:00
parent fb1230e5e3
commit 1b5eb4f3fc
3 changed files with 13 additions and 5 deletions

View file

@ -44,6 +44,12 @@
util-git
configuration)
;; HTML entities
(define (sanitize-html str)
(string-translate*
str
'(("&" . "&amp;") ("<" . "&lt;") (">" . "&gt;") ("\"" . "&quot;"))))
;; Prints the HTML summary for given member to current-output-port
(define (print-html-member mr)
(print "<html>")
@ -62,9 +68,8 @@
(print "<hr>")
(print "<h2>Member file</h2>")
(print "<pre>")
(print (string-translate*
(string-intersperse (brmember-source mr) "\n")
'(("&" . "&amp;") ("<" . "&lt;") (">" . "&gt;") ("\"" . "&quot;"))))
(print (sanitize-html
(string-intersperse (brmember-source mr) "\n")))
(print "</pre>")
(print "<hr>")
(print "<h2>Payments history</h2>")
@ -94,7 +99,8 @@
(print "<hr>")
(print "<h2>Member File Git Log</h2>")
(print "<pre>")
(for-each print
(for-each (lambda (l)
(print (sanitize-html l)))
((git (*members-directory*) #:output)
'log '-p '--
(brmember-file-name mr)))