fixes #28
This commit is contained in:
@@ -335,10 +335,11 @@ public class Mustache
|
||||
parseChar(NO_CHAR);
|
||||
}
|
||||
|
||||
} else if (c == delims.start1 && text.length() > 0) {
|
||||
} else if (c == delims.start1 && text.length() > 0 && text.charAt(0) != '!') {
|
||||
// if we've already matched some tag characters and we see a new start tag
|
||||
// character (e.g. "{{foo {" but not "{{{"), treat the already matched text as
|
||||
// plain text and start matching a new tag from this point
|
||||
// plain text and start matching a new tag from this point, unless we're in
|
||||
// a comment tag.
|
||||
restoreStartTag(text, delims);
|
||||
accum.addTextSegment(text);
|
||||
tagStartColumn = column;
|
||||
|
||||
@@ -169,6 +169,10 @@ public class MustacheTest
|
||||
test("foobar", "foo{{! nothing to see here}}bar", new Object());
|
||||
}
|
||||
|
||||
@Test public void testCommentWithFunnyChars() {
|
||||
test("foobar", "foo{{! {baz\n }}bar", new Object());
|
||||
}
|
||||
|
||||
@Test(expected=UnsupportedOperationException.class)
|
||||
public void testPartialUseWhenUnconfigured () {
|
||||
test(null, "{{>foo}}", null);
|
||||
|
||||
Reference in New Issue
Block a user