From c9d0a0c48cedf85b3e3929ebda3cefb8cb74cc4f Mon Sep 17 00:00:00 2001 From: Ekaitz Zarraga Date: Thu, 5 Oct 2023 22:42:44 +0200 Subject: [PATCH] doc: Add explanation on how to avoid escaping in SXML MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * doc/ref/sxml.texi (Reading and Writing XML): Add explanation on using a procedure to avoid escaping. Signed-off-by: Ludovic Courtès --- doc/ref/sxml.texi | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/doc/ref/sxml.texi b/doc/ref/sxml.texi index 3502c3f1a..fceb30655 100644 --- a/doc/ref/sxml.texi +++ b/doc/ref/sxml.texi @@ -204,6 +204,21 @@ the current output port, unless the optional argument @var{port} is present. @end deffn +Output is automatically escaped as expected for a serializer. + +@example +(sxml->xml `(code "Some example")) +@result{} <i>Some example</i> +@end example + +In order to avoid some string from being escaped, it must be wrapped in a +procedure that writes the string to the @code{(current-output-port)}. + +@example +(sxml->xml `(code ,(lambda () (display "Some example")))) +@result{} Some example +@end example + @deffn {Scheme Procedure} sxml->string sxml Detag an sxml tree @var{sxml} into a string. Does not perform any formatting.