Skip to content

Commit 141522f

Browse files
committed
precompile helper dosen't support 'partial with parameter' fix #596
1 parent 7777440 commit 141522f

2 files changed

Lines changed: 22 additions & 0 deletions

File tree

  • handlebars/src

handlebars/src/main/java/com/github/jknack/handlebars/internal/Partial.java

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -290,6 +290,14 @@ public String text() {
290290
if (context != null) {
291291
buffer.append(' ').append(context);
292292
}
293+
String params = paramsToString(this.params);
294+
if (params.length() > 0) {
295+
buffer.append(" ").append(params);
296+
}
297+
String hash = hashToString();
298+
if (hash.length() > 0) {
299+
buffer.append(" ").append(hash);
300+
}
293301

294302
buffer.append(endDelimiter);
295303

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
package com.github.jknack.handlebars.issues;
2+
3+
import com.github.jknack.handlebars.v4Test;
4+
import static org.junit.Assert.assertEquals;
5+
import org.junit.Test;
6+
7+
public class Issue596 extends v4Test {
8+
9+
@Test
10+
public void shouldSupportNoneCharSequenceReturnsTypeFromHelperClass() throws Exception {
11+
String text = compile("{{> partial root=this name=\"Han\"}}").text();
12+
assertEquals("{{>partial root=this name=\"Han\"}}", text);
13+
}
14+
}

0 commit comments

Comments
 (0)