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: Alex Shinn
Subject: Re: [Chicken-users] html->sxml (html-parser egg) does not decode entities in html attributes, ideas why?
Date: Wed, 4 Sep 2013 22:00:14 +0900

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]