From d24c78628003c114c9f37f9203a7de09d8c883d6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Hugo=20H=C3=B6rnquist?= Date: Sun, 12 Jun 2022 03:12:06 +0200 Subject: Escape some unicode in initial xhtml output. While not necessary, since both HTML and XHTML allows for direct UTF-8, the validator fails on it. --- module/calp/html/vcomponent.scm | 18 ++++++++++++------ 1 file changed, 12 insertions(+), 6 deletions(-) diff --git a/module/calp/html/vcomponent.scm b/module/calp/html/vcomponent.scm index 85c3829c..b7702de1 100644 --- a/module/calp/html/vcomponent.scm +++ b/module/calp/html/vcomponent.scm @@ -28,6 +28,12 @@ ) +(define (xml-entities s) + (lambda () + (for-each display + (map (lambda (c) (format #f "&#x~x;" (char->integer c))) + (string->list s))))) + (define-public (format-summary ev str) ((summary-filter) ev str)) @@ -595,20 +601,20 @@ (title ,(_ "Fullscreen")) ;; (aria-label "") ) - "🗖") + ,(xml-entities "🗖")) (button (@ (class "remove-button") ;; Remove/Trash the event this popup represent ;; Think garbage can (title ,(_ "Remove"))) - "🗑")) + ,(xml-entities "🗑"))) (tab-group (@ (class "window-body")) (vevent-description - (@ (data-label "📅") (data-title ,(_ "Overview")) + (@ (data-label ,(xml-entities "📅")) (data-title ,(_ "Overview")) (class "vevent"))) (vevent-edit - (@ (data-label "🖊") + (@ (data-label ,(xml-entities "🖊")) (data-title ,(_ "Edit")) ;; Used by JavaScript to target this tab (data-originaltitle "Edit"))) @@ -617,10 +623,10 @@ ;; (@ (data-label "↺") (data-title "Upprepningar"))) (vevent-changelog - (@ (data-label "📒") + (@ (data-label ,(xml-entities "📒")) (data-title ,(_ "Changelog")))) ,@(when (debug) `((vevent-dl - (@ (data-label "🐸") + (@ (data-label ,(xml-entities "🐸")) (data-title ,(_ "Debug")))))))))) -- cgit v1.2.3