From: Jacob L. Anawalt <janawalt@ge...> - 2014-01-20 20:50:37
Before I get into my "me too" validation bit, I want to express my thanks to
Michael Peters and the others that have brought HTML::Template to where it is. I
love the light-weight nature and assistance keeping presentation separate from
business logic. Having the filters/escape values for html, js, and url is a
I recently gave Eclipse EPIC a hand and thought I may as well edit the HTML and
template files in Eclipse as well, via it's built-in Web Tools Platform (WTP)
code. Right away I ran into validation errors with attribute values that needed
HTML::Template VARs, like this:
<link rel="stylesheet" href="<!-- TMPL_VAR NAME=BASEURL -->/admin.css"
The WTP parser would get confused and say that the link tag wasn't closed, just
like it did for Dietrich Streifert in his question from 5 Jul 2006.
Scouring around, I came across the vanguard_compatibility_mode "error detection
option" that I had been ignoring because I'm not at Vanguard Media. Using
%BASEURL% instead of anything starting and ending with html-looking <> tags.
This worked pretty well.
Like others have been, I am concerned about the viability of using that flag
based on it's name and documentation. Also, I miss the filter/escape available
using the standard method and I wouldn't mind still having die_on_bad_params.
I appreciate the HTML comment (<!-- -->) option of HTML::Template. It helps a
lot. I'm not a fanatic about valid HTML but these helpful IDEs are. I would love
some optional syntax to use inside of tags so they don't look like unclosed
start tags. Here are some initial ideas:
1) Have a percent_escapes option that acts like an alias to
vanguard_compatibility_mode, except that it doesn't disable die_on_bad_params if
2) Be able to select a filter, maybe with an extra leading character like this:
* %:BASEURL% - HTML escape filter
* %=BASEURL% - URL escape filter
or by replacing ~(TMPL_ PATTERN)~ with <TMPL_ PATTERN> like this:
* ~TMPL_VAR NAME="BASEURL" ESCAPE="HTML"~
I prefer the first option.
I hope this isn't feature creep. I appreciate that HTML::Template has provisions
to be more pre-output validation friendly than other systems, including the
prominent non-Perl ones. I was hoping that changes like this would close a
frequently annoying hole in it's validation friendliness.
Thank you for your thoughts,
Gecko Software, Inc.