unofficial mirror of guile-devel@gnu.org 
 help / color / mirror / Atom feed
From: Maxime Devos <maximedevos@telenet.be>
To: "Aleix Conchillo Flaqué" <aconchillo@gmail.com>,
	guile-user <guile-user@gnu.org>,
	guile-devel <guile-devel@gnu.org>
Subject: Re: avoid character encoding/escaping in sxml->xml or htmlprag's sxml->html
Date: Sat, 20 Aug 2022 23:48:09 +0200	[thread overview]
Message-ID: <4425bd42-90fa-c083-717d-8b7def122e59@telenet.be> (raw)
In-Reply-To: <CA+XASoUW2m9WfYgxJs8CazX=d_nBtUDU456fVsJLPBLrvnB3jg@mail.gmail.com>


[-- Attachment #1.1.1: Type: text/plain, Size: 1327 bytes --]

The GuileScript looks nice, for interested readers, see 
<https://github.com/aconchillo/guilescript>

On 20-08-2022 21:59, Aleix Conchillo Flaqué wrote:
> However, I'm not able to find a way to avoid character 
> encoding/escaping and the generated code inside <script> will always 
> have "&lt;", etc. And <script> is a place where encodings can be 
> avoided. This is true for both Guile and guile-lib's (htmlprag), even 
> though htmlprag's escapes less characters (e.g. double quotes).
>
> One way I found to solve this was to have <script src="fib.js"> and 
> then have a handler for fib.js that would just return the transpiled 
> string. But it's not as nice, it's extra work and it's also an 
> additional roundtrip to the server.
>
> Has anyone ran into this issue? Would is make sense to add a keyword 
> argument to (sxml->xml)? For example, (sxml->xml SXML PORT #:escape #f).

Having unescaped < in <script>...</script> does not seem valid XML to me.

Does escaping &lt; actually cause problems?  If so, you could look into 
declaring your web page as XHTML, with an appropriate doctype and 
Content-Type.

I would expect XHTML to accept &lt; and reject unescaped <, being XML 
and not the messy syntax of HTML, but it's not something I have tried 
out myself.

Greetings,
Maxime.


[-- Attachment #1.1.2: OpenPGP public key --]
[-- Type: application/pgp-keys, Size: 929 bytes --]

[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 236 bytes --]

  reply	other threads:[~2022-08-20 21:48 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-08-20 19:59 avoid character encoding/escaping in sxml->xml or htmlprag's sxml->html Aleix Conchillo Flaqué
2022-08-20 21:48 ` Maxime Devos [this message]
2022-08-21  0:05   ` Aleix Conchillo Flaqué
2022-08-21  5:09     ` tomas
2022-08-21 10:16     ` Maxime Devos
2022-08-21 10:23       ` tomas
2022-08-21 22:34       ` Aleix Conchillo Flaqué

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.gnu.org/software/guile/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=4425bd42-90fa-c083-717d-8b7def122e59@telenet.be \
    --to=maximedevos@telenet.be \
    --cc=aconchillo@gmail.com \
    --cc=guile-devel@gnu.org \
    --cc=guile-user@gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).