- @Override
- public void output(PrintWriter out, Language l, Map<String, Object> vars) {
- Template.outputVar(out, l, vars, raw);
- }
-}
\ No newline at end of file
+ private final boolean unescaped;
+
+ /**
+ * Creates a new OutputVariableCommand.
+ *
+ * @param raw
+ * the variable to emit. If starting with <code>!</code> the
+ * variable is emitted non-HTML-escaped.
+ */
+ public OutputVariableCommand(String raw) {
+ if (raw.charAt(0) == '!') {
+ unescaped = true;
+ this.raw = raw.substring(1);
+ } else {
+ unescaped = false;
+ this.raw = raw;
+ }
+ }
+
+ @Override
+ public void output(PrintWriter out, Language l, Map<String, Object> vars) {
+ Template.outputVar(out, l, vars, raw, unescaped);
+ }
+
+ @Override
+ public void addTranslations(Collection<String> s) {}
+}