Re: Mason2: no default HTML escaping

Jonathan Swartz <[email protected]>
Newsgroups gmane.comp.web.mason.user
Message-ID <[email protected]>
On Mar 6, 2012, at 5:18 PM, Paul Wallingford wrote:

> On 3/6/2012 4:11 PM, Jonathan Swartz wrote:
>> I hear your concerns. So I'm not sure which of these you are suggesting:
>> 1) Substitution tags should be HTML-escaped by default in Mason.
>> 2) DefaultFilter should be implemented and documented in core Mason, so that it doesn't require a separate plugin install.
>> 
>> #1 is hard to do because Mason is supposed to be content-type agnostic - usable for HTML generation but also other kinds of content generation.
>> 
>> #2 is more reasonable.
>> 
> 
> Here is a question to ponder.
> 
> Mason, it seems, was born originally with the idea in mind for 
> generating web pages.  Tools that are generic have their place, but so 
> do tools that specialize.  Tools that specialize can implement 
> optimizations since they do not have to consider possibilities outside 
> their specialty.  Case in point is the question of HTML filters in the 
> Mason core.
> 
> So, the question is: Has anyone used Mason for anything serious other 
> than web page generation?  If the amount of people or projects using 
> Mason that are not web based is essentially zero, it may be better to 
> add web specific features and optimizations.
> 
> I do not know the answer to this question, except my own experience, 
> which is that 100% of my Mason projects are for the web.

I use Mason to generate httpd and other conf files at work.

You're probably correct, though, that 99% of Mason's use is in generating web content. However, that isn't always HTML pages; I've used it to generate javscript and JSON results too, where HTML escaping would definitely be unwelcome.

So I think it's better to have a well-supported, easy way to html-escape all substitution tags than to put this in as the global default.

Jon


------------------------------------------------------------------------------
Virtualization & Cloud Management Using Capacity Planning
Cloud computing makes use of virtualization - but cloud computing 
also focuses on allowing computing to be delivered as a service.
http://www.accelacomm.com/jaw/sfnl/114/51521223/
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.