Unescape attribute

142 views
Skip to first unread message

ngocdaothanh

unread,
Nov 25, 2010, 3:11:47 AM11/25/10
to Scalate
Hi,

I would like to ask about how to unescape HTML element's attribute.

For example, I am using Jade style and I have to write:
input(type="submit" value="Submit »")

I prefer:
input(type="submit" value="Submit »")

But "&" is automatically escaped.

I searched http://scalate.fusesource.org/ and this Google group but
could not find a solution.

Thanks.

James Strachan

unread,
Nov 25, 2010, 4:06:36 AM11/25/10
to sca...@googlegroups.com

There's an FAQ on the enabling and disabling of markup escaping...
http://scalate.fusesource.org/faq.html#How_do_I_enable_or_disable_markup_esscaping

as by default we escape markup to ensure that there's no accidental
security issues & text is rendered correctly as intended.

Though that FAQ entry is focussed on dynamic expressions; in your
example you are using static text. I wonder if the escape markup code
should be a bit smarter so that it automatically detects an entity
reference like "&someName;" and avoids encoding the & in an entity
reference?

I've raised an issue so we don't forget about this...
http://www.assembla.com/spaces/scalate/support/tickets/184

--
James
-------
FuseSource
Email: ja...@fusesource.com
Web: http://fusesource.com
Twitter: jstrachan
Blog: http://macstrac.blogspot.com/

Open Source Integration

Reply all
Reply to author
Forward
0 new messages