Sanitize html, fix linking racket-kwargs.
This commit is contained in:
parent
fb1230e5e3
commit
1b5eb4f3fc
3 changed files with 13 additions and 5 deletions
|
@ -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 \
|
sgr-list.o sgr-block.o table-processor.o table-border.o \
|
||||||
table-style.o sgr-state.o util-utf8.o sgr-cell.o \
|
table-style.o sgr-state.o util-utf8.o sgr-cell.o \
|
||||||
template-list-expander.o box-drawing.o util-list.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
|
.PHONY: imports
|
||||||
imports: $(HACKERBASE-DEPS)
|
imports: $(HACKERBASE-DEPS)
|
||||||
|
|
|
@ -44,6 +44,12 @@
|
||||||
util-git
|
util-git
|
||||||
configuration)
|
configuration)
|
||||||
|
|
||||||
|
;; HTML entities
|
||||||
|
(define (sanitize-html str)
|
||||||
|
(string-translate*
|
||||||
|
str
|
||||||
|
'(("&" . "&") ("<" . "<") (">" . ">") ("\"" . """))))
|
||||||
|
|
||||||
;; Prints the HTML summary for given member to current-output-port
|
;; Prints the HTML summary for given member to current-output-port
|
||||||
(define (print-html-member mr)
|
(define (print-html-member mr)
|
||||||
(print "<html>")
|
(print "<html>")
|
||||||
|
@ -62,9 +68,8 @@
|
||||||
(print "<hr>")
|
(print "<hr>")
|
||||||
(print "<h2>Member file</h2>")
|
(print "<h2>Member file</h2>")
|
||||||
(print "<pre>")
|
(print "<pre>")
|
||||||
(print (string-translate*
|
(print (sanitize-html
|
||||||
(string-intersperse (brmember-source mr) "\n")
|
(string-intersperse (brmember-source mr) "\n")))
|
||||||
'(("&" . "&") ("<" . "<") (">" . ">") ("\"" . """))))
|
|
||||||
(print "</pre>")
|
(print "</pre>")
|
||||||
(print "<hr>")
|
(print "<hr>")
|
||||||
(print "<h2>Payments history</h2>")
|
(print "<h2>Payments history</h2>")
|
||||||
|
@ -94,7 +99,8 @@
|
||||||
(print "<hr>")
|
(print "<hr>")
|
||||||
(print "<h2>Member File Git Log</h2>")
|
(print "<h2>Member File Git Log</h2>")
|
||||||
(print "<pre>")
|
(print "<pre>")
|
||||||
(for-each print
|
(for-each (lambda (l)
|
||||||
|
(print (sanitize-html l)))
|
||||||
((git (*members-directory*) #:output)
|
((git (*members-directory*) #:output)
|
||||||
'log '-p '--
|
'log '-p '--
|
||||||
(brmember-file-name mr)))
|
(brmember-file-name mr)))
|
||||||
|
|
|
@ -26,6 +26,8 @@
|
||||||
;; CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
|
;; CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
|
||||||
;;
|
;;
|
||||||
|
|
||||||
|
(declare (unit racket-kwargs))
|
||||||
|
|
||||||
(module
|
(module
|
||||||
racket-kwargs
|
racket-kwargs
|
||||||
(
|
(
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue