From: <tomas@tuxteam.de>
To: Jakub Jankiewicz <jcubic@jcubic.pl>
Cc: guile-user@gnu.org
Subject: Re: How to render raw data using sxml?
Date: Wed, 13 Jul 2016 11:57:46 +0200 [thread overview]
Message-ID: <20160713095745.GA30577@tuxteam.de> (raw)
In-Reply-To: <20160712222320.76ce7254@jcubic>
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1
On Tue, Jul 12, 2016 at 10:23:20PM +0200, Jakub Jankiewicz wrote:
[...]
> I've commented out (#\" . "quot") in alist->hash-table and it work. thanks
> for your help.
I wised up a bit, to get an idea on how it's supposed to work (if there's
such a thing on the Internet ;-) and found out:
- in XHTML, the content of the script tag is parsed character data
(#PCDATA). This means that entities (" and so on) *will be
parsed and substituted*. Not so for HTML: there it's raw character
data (#CDATA), and no entity substitution is supposed to happen [1]
So your approach goes in the right direction. When outputting
HTML, no substitution is supposed to be done (no " and no
< and so on).
- But how you keep your thing from tripping over some nasty
</script> deeply embedded in the javascript text, then?
The very readable [2] suggests: don't do it, then. That
means: munge the javascript until it doesn't contain that
nastygram. E.g.
var nasty="</script\>";
Whee. Looks kinda cool, somehow. (that means you can only
automate this task if you manage to kinda half-parse the
provided javascript thing, right? But perhaps one can prove
that "</" isn't a valid sequence in javascript outside a
string literal?).
Hope you enjoyed that ;-)
[1] http://www.w3schools.com/tags/tag_script.asp
[2] http://jibbering.com/faq/faq_notes/script_tags.html
- -- tomás
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.12 (GNU/Linux)
iEYEARECAAYFAleGEJkACgkQBcgs9XrR2kZxlgCfR+ypMDs0oAeT/G5NbGnqw0Ib
2Y0An3Ll/SbA8QH7V88u965pXVj9Ovfu
=2Ow0
-----END PGP SIGNATURE-----
next prev parent reply other threads:[~2016-07-13 9:57 UTC|newest]
Thread overview: 15+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-07-10 19:58 How to render raw data using sxml? Jakub Jankiewicz
2016-07-11 6:48 ` tomas
2016-07-11 20:58 ` Amirouche Boubekki
2016-07-12 20:20 ` Jakub Jankiewicz
2016-07-12 20:23 ` Jakub Jankiewicz
2016-07-13 9:57 ` tomas [this message]
2016-07-14 10:29 ` Andy Wingo
2016-07-14 10:47 ` tomas
2016-07-14 13:21 ` Matt Wette
2016-07-14 20:45 ` tomas
2016-07-15 10:40 ` Amirouche Boubekki
2016-07-15 12:44 ` Matt Wette
2016-07-13 12:28 ` Matt Wette
2016-07-13 13:36 ` tomas
2016-07-14 10:23 ` Andy Wingo
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=20160713095745.GA30577@tuxteam.de \
--to=tomas@tuxteam.de \
--cc=guile-user@gnu.org \
--cc=jcubic@jcubic.pl \
/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).