Skip to content

Commit 77b67c9

Browse files
committed
Update IT
1 parent 8459943 commit 77b67c9

File tree

3 files changed

+39
-11
lines changed

3 files changed

+39
-11
lines changed

CHANGELOG.adoc

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -17,15 +17,19 @@ Bug Fixes::
1717

1818
* Fix open IMG tags in parser-doxia-module (#930)
1919
* Fix naming in Asciidoctor Converter Doxia Module pom (#934)
20+
* Fix empty table generating <table> element (asciidoctor-parser-doxia-module) (#938)
2021

2122
Improvements::
2223

2324
* Added support for AsciidoctorJ v3.0.0 (#651)
2425
* Add compatibility with maven-site-plugin v3.20.0 and Doxia v2.0.0 (#933)
25-
* Add support for code blocks titles in asciidoctor-parser-doxia-module (#935)
26-
* Refactor AST traversal method in asciidoctor-parser-doxia-module (#944)
26+
* Add support for code blocks titles (asciidoctor-parser-doxia-module) (#935)
27+
* Refactor AST traversal method (asciidoctor-parser-doxia-module) (#944)
2728
* Empty titles in document or empty literals no longer generate <h1> or <pre> in asciidoctor-parser-doxia-module (#944)
28-
* Sections are now wrapped in <div> in asciidoctor-parser-doxia-module (#944)
29+
* Sections are now wrapped in <div> in (asciidoctor-parser-doxia-module) (#944)
30+
* Add support for inline and Example blocks (asciidoctor-parser-doxia-module) (#938)
31+
* Add support for captioned titles in appendixes, tables, listing, figure, and examples (asciidoctor-parser-doxia-module) (#938)
32+
2933

3034
Build / Infrastructure::
3135

asciidoctor-parser-doxia-module/src/it/maven-site-plugin/src/site/asciidoc/sample.adoc

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -91,3 +91,16 @@ Linux:::
9191
BSD:::
9292
. FreeBSD
9393
. NetBSD
94+
95+
=== Examples
96+
97+
.Optional title (1)
98+
====
99+
This is an example of an example block (1).
100+
====
101+
102+
.Optional title (2)
103+
[example]
104+
This is an example of an example block (2).
105+
*dadsas* https://dasd.com
106+

asciidoctor-parser-doxia-module/src/it/maven-site-plugin/validate.groovy

Lines changed: 19 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -58,6 +58,10 @@ new HtmlAsserter(htmlContent).with { asserter ->
5858
asserter.containsUnorderedList("Desktop", "Server")
5959
asserter.descriptionListTerm("BSD")
6060
asserter.containsOrderedList("FreeBSD", "NetBSD")
61+
62+
asserter.containsSectionTitle("Examples", 3)
63+
asserter.containsExampleDiv()
64+
asserter.containsExampleDiv()
6165
}
6266

6367
String strong(String text) {
@@ -224,8 +228,15 @@ class HtmlAsserter {
224228
}
225229
}
226230

231+
void containsExampleDiv() {
232+
final def key = "<div style=\"background: #fffef7;"
233+
def found = find(key)
234+
assertFound("Example <div>", key, found)
235+
}
236+
227237
void assertTableCaption(String htmlBlock, String caption) {
228-
def start = htmlBlock.indexOf("<caption>") + "<caption>".length()
238+
def start = htmlBlock.indexOf("<caption") + "<caption".length()
239+
start = htmlBlock.indexOf(">", start) + 1
229240
def end = htmlBlock.indexOf("</caption>")
230241
if (start < 0 || end < 0)
231242
fail("Caption not found ($start, $end)")
@@ -239,11 +250,11 @@ class HtmlAsserter {
239250

240251
void assertTableHeaders(String htmlBlock, List<String> headers) {
241252
def actualHeaders = Arrays.stream(htmlBlock.split("<"))
242-
.filter(line -> line.startsWith("th>"))
243-
.map(line -> {
244-
return line.substring("th>".length())
245-
})
246-
.collect(Collectors.toList())
253+
.filter(line -> line.startsWith("th>"))
254+
.map(line -> {
255+
return line.substring("th>".length())
256+
})
257+
.collect(Collectors.toList())
247258

248259
if (actualHeaders != headers)
249260
fail("Table headers not valid. Found: $actualHeaders, expected: $headers")
@@ -266,8 +277,8 @@ class HtmlAsserter {
266277
// Removes linebreaks to validate to avoid OS dependant issues.
267278
private String clean(String value) {
268279
return value.replaceAll("\r\n", "")
269-
.replaceAll("\n", "")
270-
.trim();
280+
.replaceAll("\n", "")
281+
.trim();
271282
}
272283
}
273284

0 commit comments

Comments
 (0)