Skip to content

Commit

Permalink
Merge pull request quarkusio#7930 from mkouba/qute-raw-validation
Browse files Browse the repository at this point in the history
Qute type-safe templates - fix inconsitency in "raw" validation
  • Loading branch information
gsmet authored Mar 18, 2020
2 parents 391d390 + baf7343 commit 40b2888
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -718,7 +718,7 @@ void excludeTypeChecks(BuildProducer<TypeCheckExcludeBuildItem> excludes) {
@Override
public boolean test(Check check) {
// RawString
if (check.isProperty() && check.classNameEquals(STRING) && check.nameIn("raw", "safe")) {
if (check.isProperty() && check.nameIn("raw", "safe")) {
return true;
}
// Elvis and ternary operators
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,15 +20,16 @@ public class ObjectValidationSuccessTest {
.setArchiveProducer(() -> ShrinkWrap.create(JavaArchive.class)
.addClasses(Movie.class, MovieExtensions.class)
.addAsResource(new StringAsset("{@java.lang.Object obj}"
+ "{obj.toString}"),
+ "{@java.lang.Object anotherObj}"
+ "{obj.toString}:{anotherObj.raw}"),
"templates/object.html"));

@Inject
Template object;

@Test
public void testResult() {
assertEquals("hello", object.data("obj", "hello").render());
assertEquals("hello:<strong>", object.data("obj", "hello").data("anotherObj", "<strong>").render());
}

}

0 comments on commit 40b2888

Please sign in to comment.