diff --git a/extensions/qute/deployment/src/test/java/io/quarkus/qute/deployment/EscapingTest.java b/extensions/qute/deployment/src/test/java/io/quarkus/qute/deployment/EscapingTest.java index a5c54c1a4fa16..dbd4e830f0ab3 100644 --- a/extensions/qute/deployment/src/test/java/io/quarkus/qute/deployment/EscapingTest.java +++ b/extensions/qute/deployment/src/test/java/io/quarkus/qute/deployment/EscapingTest.java @@ -2,6 +2,8 @@ import static org.junit.jupiter.api.Assertions.assertEquals; +import java.util.Locale; + import javax.inject.Inject; import org.jboss.shrinkwrap.api.ShrinkWrap; @@ -14,6 +16,7 @@ import io.quarkus.qute.RawString; import io.quarkus.qute.Template; import io.quarkus.qute.TemplateData; +import io.quarkus.qute.Variant; import io.quarkus.test.QuarkusUnitTest; public class EscapingTest { @@ -61,6 +64,13 @@ public void testValidation() { engine.getTemplate("validation").data("text", "
").render()); } + @Test + public void testEngineParse() { + assertEquals("<div>
", + engine.parse("{text} {text.raw}", + new Variant(Locale.ENGLISH, "text/html", "UTF-8")).data("text", "
").render()); + } + @TemplateData public static class Item { diff --git a/independent-projects/qute/core/src/main/java/io/quarkus/qute/Engine.java b/independent-projects/qute/core/src/main/java/io/quarkus/qute/Engine.java index b2b8db68b515c..e738fa08387ad 100644 --- a/independent-projects/qute/core/src/main/java/io/quarkus/qute/Engine.java +++ b/independent-projects/qute/core/src/main/java/io/quarkus/qute/Engine.java @@ -27,7 +27,7 @@ static EngineBuilder builder() { * @return the template */ default Template parse(String content) { - return parse(content, null); + return parse(content, null, null); } /** @@ -40,7 +40,7 @@ default Template parse(String content) { * @return the template */ default Template parse(String content, Variant variant) { - return parse(content, null, null); + return parse(content, variant, null); } /**