[plt-scheme] string->html/response
On Wed, Dec 17, 2008 at 6:43 AM, Dave Gurnell <d.j.gurnell at gmail.com> wrote:
> A simpler option might be to use an output format that allows you to include
> raw unquoted strings in your X(H)TML output. This way so you never need to
> parse the HTML from the blog post. Mirrors.plt allows this via its "!raw"
> syntax.
Mirrors is great. But just to clarify, you can get raw unquoted
strings in the X-expression syntax with cdata structs:
Examples:
(make-cdata #f #f "<b>bold</b>")
> (display
(xexpr->string
`(html
(body (h1 "Post Title")
,(make-cdata #f #f
"<p><b>Bold!</b></p>")))))
<html><body><h1>Post Title</h1><p><b>Bold!</b></p></body></html>
>
--
Jay McCarthy <jay at cs.byu.edu>
Assistant Professor / Brigham Young University
http://jay.teammccarthy.org
"The glory of God is Intelligence" - D&C 93