- <?=$!variablename?> will output the variable "variablename" but not HTML-escaped
- <?=s,$!variablename,My %s text?> will insert the variable "variablename" into the translated text but not HTML-escaped
+- <?=s,"some data",My %s text?> will insert "some data" into the translated text literally (not HTML-escaped)
- <? if($variable) { ?>
Output/execute the text until "<? } ?>" only if $variable not null or Boolean.FALSE.
String var = myvars[j - 1];
if (var.startsWith("$!")) {
Template.outputVar(out, l, vars, myvars[j - 1].substring(2), true);
+ } else if (var.startsWith("\"")) {
+ out.print(var.substring(1));
} else {
Template.outputVar(out, l, vars, myvars[j - 1].substring(1), false);
}
} else if (s2.startsWith("=s,")) {
String command = s2.substring(3);
final LinkedList<String> store = new LinkedList<String>();
- while (command.startsWith("$")) {
- int idx = command.indexOf(",");
- store.add(command.substring(0, idx));
+ while (command.startsWith("$") || command.startsWith("\"")) {
+ int idx;
+ if (command.startsWith("\"")) {
+ idx = command.indexOf("\"", 1) + 1;
+ store.add(command.substring(0, idx - 1));
+ } else {
+ idx = command.indexOf(",");
+ store.add(command.substring(0, idx));
+ }
command = command.substring(idx + 1);
}
final String text = command;