-
Notifications
You must be signed in to change notification settings - Fork 172
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #397 from robertpanzer/slim_3.0.6
Bump slim to 3.0.6
- Loading branch information
Showing
3 changed files
with
35 additions
and
1 deletion.
There are no files selected for viewing
33 changes: 33 additions & 0 deletions
33
asciidoctorj-core/src/test/java/org/asciidoctor/WhenSlimTemplatesAreUsed.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,33 @@ | ||
package org.asciidoctor; | ||
|
||
import org.asciidoctor.util.ClasspathResources; | ||
import org.jsoup.Jsoup; | ||
import org.jsoup.nodes.Element; | ||
import org.junit.Rule; | ||
import org.junit.Test; | ||
|
||
import static org.junit.Assert.assertEquals; | ||
|
||
public class WhenSlimTemplatesAreUsed { | ||
|
||
@Rule | ||
public ClasspathResources classpath = new ClasspathResources(); | ||
|
||
private Asciidoctor asciidoctor = Asciidoctor.Factory.create(); | ||
|
||
@Test | ||
public void the_slim_paragraph_template_should_be_used_when_rendering_a_document_inline() throws Exception { | ||
|
||
Options options = OptionsBuilder.options().templateDir(classpath.getResource("src/custom-backends/slim")).toFile(false).headerFooter(false).get(); | ||
|
||
String sourceDocument = "= Hello World\n" + | ||
"\n" + | ||
"This will be replaced by static content from the template"; | ||
|
||
String renderContent = asciidoctor.render(sourceDocument, options); | ||
|
||
Element doc = Jsoup.parse(renderContent, "UTF-8"); | ||
Element paragraph = doc.select("p").first(); | ||
assertEquals("This is static content", paragraph.text()); | ||
} | ||
} |
1 change: 1 addition & 0 deletions
1
asciidoctorj-core/src/test/resources/src/custom-backends/slim/block_paragraph.html.slim
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 @@ | ||
p This is static content |
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