Skip to content

Commit

Permalink
Upgrade to Asciidoctor 2.0.18
Browse files Browse the repository at this point in the history
  • Loading branch information
robertpanzer committed Oct 15, 2022
1 parent 7903f39 commit 1d3e120
Show file tree
Hide file tree
Showing 4 changed files with 15 additions and 14 deletions.
4 changes: 4 additions & 0 deletions CHANGELOG.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,10 @@ For a detailed view of what has changed, refer to the {url-repo}/commits/main[co

== Unreleased

Improvement::

* Upgrade to asciidoctorj 2.0.18 (#1126)

== 2.5.6 (2022-09-19)

Improvement::
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -46,10 +46,11 @@
import static org.hamcrest.CoreMatchers.not;
import static org.hamcrest.CoreMatchers.notNullValue;
import static org.hamcrest.CoreMatchers.startsWith;
import static org.hamcrest.MatcherAssert.assertThat;
import static org.hamcrest.Matchers.hasSize;
import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertNotNull;
import static org.junit.Assert.assertNull;
import static org.junit.Assert.assertThat;
import static org.junit.Assert.assertTrue;

@RunWith(Arquillian.class)
Expand Down Expand Up @@ -111,8 +112,6 @@ private StringBuilder readContent(String target) {

bufferedReader.close();

} catch (MalformedURLException e) {
throw new IllegalArgumentException(e);
} catch (IOException e) {
throw new IllegalArgumentException(e);
}
Expand Down Expand Up @@ -180,8 +179,6 @@ private StringBuilder readContent(String target) {

bufferedReader.close();

} catch (MalformedURLException e) {
throw new IllegalArgumentException(e);
} catch (IOException e) {
throw new IllegalArgumentException(e);
}
Expand Down Expand Up @@ -242,7 +239,7 @@ public void a_docinfoprocessor_should_be_executed_and_add_meta_in_footer() {

Element footer = doc.getElementById("footer");
// Since Asciidoctor 1.5.3 the docinfo in the footer is a sibling to the footer element
assertTrue("robots".equals(footer.nextElementSibling().attr("name")));
assertEquals("robots", footer.nextElementSibling().attr("name"));
}

@Test
Expand Down Expand Up @@ -436,7 +433,7 @@ public void a_include_processor_should_only_handle_its_handles() {

org.jsoup.nodes.Document doc = Jsoup.parse(content, "UTF-8");

Element contentElement = doc.getElementsByAttributeValue("class", "bare").first();
Element contentElement = doc.getElementsByClass("bare").first();

assertThat(contentElement.text(), startsWith("sample-book.adoc"));

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -47,12 +47,12 @@
import static org.hamcrest.CoreMatchers.not;
import static org.hamcrest.CoreMatchers.notNullValue;
import static org.hamcrest.CoreMatchers.startsWith;
import static org.hamcrest.MatcherAssert.assertThat;
import static org.hamcrest.Matchers.hasSize;
import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertNotNull;
import static org.junit.Assert.assertNull;
import static org.junit.Assert.assertSame;
import static org.junit.Assert.assertThat;
import static org.junit.Assert.assertTrue;

@RunWith(Arquillian.class)
public class WhenJavaExtensionIsRegistered {
Expand Down Expand Up @@ -239,7 +239,7 @@ public void a_docinfoprocessor_should_be_executed_and_add_meta_in_footer() {

Element footer = doc.getElementById("footer");
// Since Asciidoctor 1.5.3 the docinfo in the footer is a sibling to the footer element
assertTrue("robots".equals(footer.nextElementSibling().attr("name")));
assertEquals("robots", footer.nextElementSibling().attr("name"));
}

@Test
Expand Down Expand Up @@ -429,11 +429,11 @@ public void a_include_processor_should_only_handle_its_handles() {
javaExtensionRegistry.includeProcessor(UriIncludeProcessor.class);

String content = asciidoctor.convertFile(classpath.getResource("sample-with-include.ad"),
options().toFile(false).get());
Options.builder().toFile(false).build());

org.jsoup.nodes.Document doc = Jsoup.parse(content, "UTF-8");

Element contentElement = doc.getElementsByAttributeValue("class", "bare").first();
Element contentElement = doc.getElementsByClass("bare").first();

assertThat(contentElement.text(), startsWith("sample-book.adoc"));

Expand Down
4 changes: 2 additions & 2 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -79,8 +79,8 @@ ext {
pdfboxVersion = '1.8.16'

// gem versions
asciidoctorGemVersion = project.hasProperty('asciidoctorGemVersion') ? project.asciidoctorGemVersion : '2.0.17'
asciimathGemVersion = '2.0.3'
asciidoctorGemVersion = project.hasProperty('asciidoctorGemVersion') ? project.asciidoctorGemVersion : '2.0.18'
asciimathGemVersion = '2.0.4'
coderayGemVersion = '1.1.3'
rougeGemVersion = '3.30.0'

Expand Down

0 comments on commit 1d3e120

Please sign in to comment.