jferrai at us.ibm.com
Wed Aug 13 11:08:32 PDT 2008
Right now we have both property substitution using @@foo@@ syntax and
localization substitution using %%bar%%. Kin has asked if we can extend the
syntax to take into account the fact that a given substitution string might
appear within HTML content (which has its own syntax quirks) and other
email with a proposal.
Here is what I propose - add two optional parenthetical prefixes,
(htmlchars) and (jschars) to variable references, where:
(htmlchars) transforms the substitution string to the following
replacements (aligns with PHP's htmlspecialchars()):
& with &
< with <;
> with >;
" with "
' with '
(jschars) transforms the substitution string to the following replacements
(aligns with PHP's addslashes()):
\ with \\
' with \'
" with \"
To illustrate (htmlchars), suppose your have:
and the user entered the following for the remark property: << I'm in love!
then the resulting content would be: << I'm in love! >>
To illustrate (jschars), suppose you have:
('textfield').value='<< I\'m in love! >>';
I propose a variable reference can have either (htmlchars) or (jschars) or
neither, but not both.
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the IDE