[Ur] CMS like features ? unsafe XML - encodings?
Chris Double
chris.double at double.co.nz
Sun Dec 19 22:11:30 EST 2010
On Mon, Dec 20, 2010 at 3:18 AM, Adam Chlipala <adamc at impredicative.com> wrote:
> This is what I recommend. Every XML type is just a C string from the FFI's
> perspective, so you just need to write a function that returns a string.
> You can write that type as [uw_Basis_string], [char*], or whatever other
> synonym you like. You can return normal string literals.
Thanks I'll give that a try. I'm converting an existing small webapp I
wrote in Factor a while ago to Ur/Web as a learning exercise. It's a
pretty trivial app to provide a 'river of news' list of items from
various RSS/Atom feeds, updated hourly. It's optimized for reading on
my phone and to allow adding/removing feeds and searching though past
entries. This involves reading RSS feeds and displaying the HTML from
the feeds in the page generated by Ur/Web.
The currently running Ur/Web version is at http://newsriver.co.nz. You
can see in the displayed article summaries that a lot of the HTML
slips through " , <em>, <!-- comments -->, etc". I thought I'd
use the Html parser to 'whitelist' HTML I allowed. It throws an error
on HTML it doesn't understand though. Is there a way to have it
ignore/remove non-whitelisted elements? Some way of catching the error
and continuing? Failing that I can escape to the FFI and run an
external script I guess.
So far the development has been relatively smooth. The main oddness
has been the date/time conversions that I raised Mantis issues for.
Chris.
--
http://www.bluishcoder.co.nz
More information about the Ur
mailing list