Hi Alex,

Excellent! Thanks for looking into it and for the tip re custom parsers - I was 
trying to understand that code!

Philip

________________________________
From: Alex Shinn <[email protected]>
Sent: 04 September 2013 14:00
To: Philip Kent
Cc: [email protected]
Subject: Re: [Chicken-users] html->sxml (html-parser egg) does not decode 
entities in html attributes, ideas why?

On Wed, Sep 4, 2013 at 8:23 PM, Philip Kent 
<[email protected]<mailto:[email protected]>> wrote:
Hi Alex,

Thanks for your email.

I'm somewhat confused by what you say. Through investigation, it seems 
html->sxml will decode entities, so long as they aren't within a HTML element 
attribute. Could you clarify on whether that default applies globally or just 
to attributes?

Yes, sorry, I misread my own code :)

The default is to _decode_ entities:

#;1> (html->sxml "&quot;")
(*TOP* "\"")

And as you say, it currently doesn't just process attributes:

#;2> (html->sxml "<div data-foo=\"&quot;\">")
(*TOP* (div (@ (data-foo "&quot;"))))

I'll fix this.

What I was referring to before is that you can customize
what is done with entities with

 (make-html-parser 'entity: (lambda (name) ...))

and can customize non-default entity names:

 (make-html-parser 'entities: '(("quot" . "\"") ...))

but again, these are currently ignored in attributes.

--
Alex

_______________________________________________
Chicken-users mailing list
[email protected]
https://lists.nongnu.org/mailman/listinfo/chicken-users

Reply via email to