-
Notifications
You must be signed in to change notification settings - Fork 129
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
linebreak is trimmed #126
Comments
First see this: https://github.com/samskivert/jmustache#newline-trimming Second I could not reproduce your problem. @Test
public void testTrim()
throws Exception {
String template = //
"""
{{#useBeanValidation}}{{> beanValidation}}{{/useBeanValidation}}
public Integer getZip() {
return zip;
}""";
var m = Map.of("useBeanValidation", true, "beanValidation", "@Validation");
StringReader sr = new StringReader("@Min(1) @Max(99999)");
Mustache.TemplateLoader loader = name -> sr;
String actual = Mustache.compiler()
.withLoader(loader)
.compile(template).execute(m);
String expected = "@Min(1) @Max(99999)\n" // notice new line
+ "public Integer getZip() {\n"
+ " return zip;\n"
+ "}";
assertEquals(expected, actual);
} |
I could not reproduce this. I think we can close this issue. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Trying to modify the template in the swagger code generator. The template is like
the expected result is
however this gives
the line break after
{{/useBeanValidation}}
is not preserved.The text was updated successfully, but these errors were encountered: