chicken-users
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Chicken-users] html->sxml (html-parser egg) does not decode entitie


From: Philip Kent
Subject: Re: [Chicken-users] html->sxml (html-parser egg) does not decode entities in html attributes, ideas why?
Date: Wed, 4 Sep 2013 15:39:56 +0000

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 <address@hidden>
Sent: 04 September 2013 14:00
To: Philip Kent
Cc: address@hidden
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 <address@hidden> 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


reply via email to

[Prev in Thread] Current Thread [Next in Thread]