aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorHugo Hรถrnquist <hugo@lysator.liu.se>2022-06-12 03:12:06 +0200
committerHugo Hรถrnquist <hugo@lysator.liu.se>2022-06-13 12:08:44 +0200
commitd24c78628003c114c9f37f9203a7de09d8c883d6 (patch)
treefe4afd368fc5fade3e2809cb14865b5f225bb85a
parentRemove with-label. (diff)
downloadcalp-d24c78628003c114c9f37f9203a7de09d8c883d6.tar.gz
calp-d24c78628003c114c9f37f9203a7de09d8c883d6.tar.xz
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.
-rw-r--r--module/calp/html/vcomponent.scm18
1 files 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"))))))))))