Special variables that $variable defines can be used in the inner text.
-
\ No newline at end of file
+Adding a "\" before a newline will cause both the backslash and the newline get removed. This allows non-visible line-breaks in templates.
+Note: Mail templates consist of a template for subject and a template for the body. Prolonging the subject-line with this feature is not possible.
break outer;
}
buf.append((char) ch);
+ if (endsWith(buf, "\\\n")) {
+ buf.delete(buf.length() - 2, buf.length());
+ }
}
buf.delete(buf.length() - 2, buf.length());
splitted.add(buf.toString());
vars.put("b", null);
assertEquals("false", testExecute(Language.getInstance(Locale.ENGLISH), vars, "<? if($b){ ?>true<? } else{?>false<?}?>"));
}
+
+ @Test
+ public void testIgnoredNewline() {
+ assertEquals("\\ab\\\\n\n\\c", testExecute(Language.getInstance(Locale.ENGLISH), vars, "\\a\\\nb\\\\n\n\\\\\nc"));
+ assertEquals("a\\b\\c", testExecute(Language.getInstance(Locale.ENGLISH), vars, "a\\b\\\n\\c"));
+ // \r's are currently not valid.
+ assertEquals("a\\\r\nb", testExecute(Language.getInstance(Locale.ENGLISH), vars, "a\\\r\nb"));
+ }
+
}