-
Notifications
You must be signed in to change notification settings - Fork 2.8k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Qute - remove standalone lines by default
- resolves #8753
- Loading branch information
Showing
13 changed files
with
356 additions
and
57 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
34 changes: 34 additions & 0 deletions
34
...java/io/quarkus/qute/deployment/removestandalonelines/DoNotRemoveStandaloneLinesTest.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
package io.quarkus.qute.deployment.removestandalonelines; | ||
|
||
import static org.junit.jupiter.api.Assertions.assertEquals; | ||
|
||
import javax.inject.Inject; | ||
|
||
import org.jboss.shrinkwrap.api.ShrinkWrap; | ||
import org.jboss.shrinkwrap.api.asset.StringAsset; | ||
import org.jboss.shrinkwrap.api.spec.JavaArchive; | ||
import org.junit.jupiter.api.Test; | ||
import org.junit.jupiter.api.extension.RegisterExtension; | ||
|
||
import io.quarkus.qute.Template; | ||
import io.quarkus.test.QuarkusUnitTest; | ||
|
||
public class DoNotRemoveStandaloneLinesTest { | ||
|
||
@RegisterExtension | ||
static final QuarkusUnitTest config = new QuarkusUnitTest() | ||
.setArchiveProducer(() -> ShrinkWrap.create(JavaArchive.class) | ||
.addAsResource(new StringAsset("{#for i in total}\n" | ||
+ "{i}:\n" | ||
+ "{/for}"), "templates/loop.html") | ||
.addAsResource(new StringAsset("quarkus.qute.remove-standalone-lines=false"), "application.properties")); | ||
|
||
@Inject | ||
Template loop; | ||
|
||
@Test | ||
public void testLines() { | ||
assertEquals("\n1:\n\n2:\n\n3:\n", loop.data("total", 3).render()); | ||
} | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
12 changes: 12 additions & 0 deletions
12
independent-projects/qute/core/src/main/java/io/quarkus/qute/LineSeparatorNode.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
package io.quarkus.qute; | ||
|
||
/** | ||
* A line separator. | ||
*/ | ||
public class LineSeparatorNode extends TextNode { | ||
|
||
public LineSeparatorNode(String value, Origin origin) { | ||
super(value, origin); | ||
} | ||
|
||
} |
18 changes: 18 additions & 0 deletions
18
independent-projects/qute/core/src/main/java/io/quarkus/qute/ParameterDeclarationNode.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
package io.quarkus.qute; | ||
|
||
import java.util.function.Consumer; | ||
|
||
/** | ||
* Template parameter declaration. | ||
*/ | ||
public class ParameterDeclarationNode extends TextNode { | ||
|
||
public ParameterDeclarationNode(String value, Origin origin) { | ||
super(value, origin); | ||
} | ||
|
||
@Override | ||
public void process(Consumer<String> consumer) { | ||
} | ||
|
||
} |
Oops, something went wrong.