[racket] Ensuring data fed to web-server/templates is textual

From: Jordan Johnson (jmj at fellowhuman.com)
Date: Tue Feb 7 18:50:30 EST 2012

Hi all,

I'm using web-server/templates to generate text, and the data in variables I reference in the template include s-exps that may, in some cases, contain image% objects.  I want it to render the image%s as plain text; even just the string "<IMAGE>" or similar would be adequate.

So, my question is: how (via the template system or other libraries) can I best make racket perform this translation, ideally without writing code to walk the s-exp trees?  It seems there must be a way someplace to tweak the output function used by the template library, but I don't know where that would be.


Posted on the users mailing list.