GNU bug report logs - #66366
[PATCH] doc: Add explanation on how to avoid escaping in SXML

Previous Next

Package: guile;

Reported by: Ekaitz Zarraga <ekaitz <at> elenq.tech>

Date: Thu, 5 Oct 2023 20:50:02 UTC

Severity: normal

Tags: patch

Done: Ludovic Courtès <ludo <at> gnu.org>

Bug is archived. No further changes may be made.

To add a comment to this bug, you must first unarchive it, by sending
a message to control AT debbugs.gnu.org, with unarchive 66366 in the body.
You can then email your comments to 66366 AT debbugs.gnu.org in the normal way.

Toggle the display of automated, internal messages from the tracker.

View this report as an mbox folder, status mbox, maintainer mbox


Report forwarded to bug-guile <at> gnu.org:
bug#66366; Package guile. (Thu, 05 Oct 2023 20:50:02 GMT) Full text and rfc822 format available.

Acknowledgement sent to Ekaitz Zarraga <ekaitz <at> elenq.tech>:
New bug report received and forwarded. Copy sent to bug-guile <at> gnu.org. (Thu, 05 Oct 2023 20:50:02 GMT) Full text and rfc822 format available.

Message #5 received at submit <at> debbugs.gnu.org (full text, mbox):

From: Ekaitz Zarraga <ekaitz <at> elenq.tech>
To: "bug-guile <at> gnu.org" <bug-guile <at> gnu.org>
Subject: [PATCH] doc: Add explanation on how to avoid escaping in SXML
Date: Thu, 05 Oct 2023 20:48:34 +0000
From 7754fda28a6029116ee49172af28b5aa28bcda7e Mon Sep 17 00:00:00 2001
From: Ekaitz Zarraga <ekaitz <at> elenq.tech>
Date: Thu, 5 Oct 2023 22:42:44 +0200
Subject: [PATCH] doc: Add explanation on how to avoid escaping in SXML

* doc/ref/sxml.texi (Reading and Writing XML): Add explanation on using
  a procedure to avoid escaping.
---
 doc/ref/sxml.texi | 15 +++++++++++++++
 1 file changed, 15 insertions(+)

diff --git a/doc/ref/sxml.texi b/doc/ref/sxml.texi
index 835a39b36..b92f4c29e 100644
--- a/doc/ref/sxml.texi
+++ b/doc/ref/sxml.texi
@@ -203,6 +203,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 "<i>Some example</i>"))
+@result{} <code>&lt;i&gt;Some example&lt;/i&gt;</code>
+@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 "<i>Some example</i>"))))
+@result{} <code><i>Some example</i></code>
+@end example
+
 @deffn {Scheme Procedure} sxml->string sxml
 Detag an sxml tree @var{sxml} into a string. Does not perform any
 formatting.
-- 
2.41.0






bug closed, send any further explanations to 66366 <at> debbugs.gnu.org and Ekaitz Zarraga <ekaitz <at> elenq.tech> Request was from Ludovic Courtès <ludo <at> gnu.org> to control <at> debbugs.gnu.org. (Sun, 22 Dec 2024 21:24:02 GMT) Full text and rfc822 format available.

bug archived. Request was from Debbugs Internal Request <help-debbugs <at> gnu.org> to internal_control <at> debbugs.gnu.org. (Mon, 20 Jan 2025 12:24:12 GMT) Full text and rfc822 format available.

This bug report was last modified 108 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.