From 9acd46cc990b6d4a9cfc47b72b19f5f3e988464c Mon Sep 17 00:00:00 2001 From: Ekaitz Zarraga Date: Sat, 14 Oct 2023 23:51:56 +0200 Subject: atom: escape the html summary and content --- src/atom.scm | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/src/atom.scm b/src/atom.scm index 13bb89f..d7b3ce8 100644 --- a/src/atom.scm +++ b/src/atom.scm @@ -152,6 +152,10 @@ (define (render-category cat) `(category (@(term ,cat)))) +(define (sxml->string/rendered content) + (call-with-output-string + (lambda (p) (sxml->xml content p)))) + (define (render-entry ent) `(entry (id ,(entry-id ent)) @@ -159,8 +163,8 @@ (published ,(date->string/RFC3339 (entry-published ent))) (updated ,(date->string/RFC3339 (entry-updated ent))) ,@(map render-author (entry-authors ent)) - (summary (@(type html)) ,(entry-summary ent)) - (content (@(type html)) ,(entry-content ent)) + (summary (@(type html)) ,(sxml->string/rendered (entry-summary ent))) + (content (@(type html)) ,(sxml->string/rendered (entry-content ent))) ,@(map render-category (entry-categories ent)) ,@(map render-contributor (entry-contributors ent)) ,@(map render-media (entry-media ent)))) -- cgit v1.2.3