xml-attribute-encode fits a naming convention used else
On Wed, Sep 14, 2016 at 11:48 AM, John Clements <[email protected]> wrote: > >> On Sep 14, 2016, at 5:22 AM, Jay McCarthy <[email protected]> wrote: >> >> I think that's a good idea. Go for it. Although I am tempted to >> comment on a name, I don't think it would be productive. ;) > > No, actually, I don’t like the name I proposed. After all, it doesn’t work on > an arbitrary xexpr, just on a string. Maybe string->xexpr-attr? Giminy, > that’s not right either. > > John > >> >> Jay >> >> On Tue, Sep 13, 2016 at 9:12 PM, 'John Clements' via Racket Users >> <[email protected]> wrote: >>> include-template is a nice way of gluing strings into html. Additionally, >>> using `xexpr->string` will ensure that ‘<‘, ‘>’, and ‘&’ get quoted >>> correctly. However, when a string is inserted into an attribute location, >>> double-quotes must also be quoted. xexpr->string gets this right when >>> called on the whole element: (xexpr->string ‘(a ((href “/abc\”def”)) >>> “foo”)) works just fine. But if I’m trying to insert the string “abc\”def” >>> into an href location using a template, the xexpr->string operation won’t >>> quote the double-quote. >>> >>> It’s easy to see how to implement this, and the code is right there in >>> xml/writer. Should this be added to the interface, as something like >>> xexpr->attr-string? >>> >>> John >>> >>> >>> -- >>> You received this message because you are subscribed to the Google Groups >>> "Racket Users" group. >>> To unsubscribe from this group and stop receiving emails from it, send an >>> email to [email protected]. >>> For more options, visit https://groups.google.com/d/optout. >> >> >> >> -- >> Jay McCarthy >> Associate Professor >> PLT @ CS @ UMass Lowell >> http://jeapostrophe.github.io >> >> "Wherefore, be not weary in well-doing, >> for ye are laying the foundation of a great work. >> And out of small things proceedeth that which is great." >> - D&C 64:33 > > > -- Jay McCarthy Associate Professor PLT @ CS @ UMass Lowell http://jeapostrophe.github.io "Wherefore, be not weary in well-doing, for ye are laying the foundation of a great work. And out of small things proceedeth that which is great." - D&C 64:33 -- You received this message because you are subscribed to the Google Groups "Racket Users" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. For more options, visit https://groups.google.com/d/optout.

