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

@ -55,7 +55,7 @@ HACKERBASE-OBJS=hackerbase.o testing.o listing.o cal-month.o \
sgr-list.o sgr-block.o table-processor.o table-border.o \
table-style.o sgr-state.o util-utf8.o sgr-cell.o \
template-list-expander.o box-drawing.o util-list.o \
export-web-static.o util-dir.o
export-web-static.o util-dir.o racket-kwargs.o
.PHONY: imports
imports: $(HACKERBASE-DEPS)

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)))

View file

@ -26,6 +26,8 @@
;; CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
;;
(declare (unit racket-kwargs))
(module
racket-kwargs
(