From 552ef03a36b53dea4613f8a3b7e45a45c5a6d15c Mon Sep 17 00:00:00 2001 From: Julien Boz Date: Fri, 1 Dec 2023 11:12:29 +0100 Subject: [PATCH 1/2] =?UTF-8?q?chore(confluence)=20=F0=9F=90=9D=20manage?= =?UTF-8?q?=20special=20characters=20in=20the=20page=20title?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../ddd/src/test/resources/features/complex.feature | 2 +- .../livingdoc/plugin/publish/HtmlPostProcessor.java | 9 ++++++--- .../livingdoc/plugin/publish/HtmlPostProcessorTest.java | 2 -- 3 files changed, 7 insertions(+), 6 deletions(-) diff --git a/livingdoc-examples/ddd/src/test/resources/features/complex.feature b/livingdoc-examples/ddd/src/test/resources/features/complex.feature index ee8573f..46d25ee 100644 --- a/livingdoc-examples/ddd/src/test/resources/features/complex.feature +++ b/livingdoc-examples/ddd/src/test/resources/features/complex.feature @@ -1,5 +1,5 @@ # language: en -Feature: A complex feature +Feature: A full feature that doesn't limit This is the feature description. In the feature's description, you can use asciidoctor markup as it pleases you. diff --git a/livingdoc-maven-plugin/src/main/java/ch/ifocusit/livingdoc/plugin/publish/HtmlPostProcessor.java b/livingdoc-maven-plugin/src/main/java/ch/ifocusit/livingdoc/plugin/publish/HtmlPostProcessor.java index ce95f8f..b2a9aa4 100644 --- a/livingdoc-maven-plugin/src/main/java/ch/ifocusit/livingdoc/plugin/publish/HtmlPostProcessor.java +++ b/livingdoc-maven-plugin/src/main/java/ch/ifocusit/livingdoc/plugin/publish/HtmlPostProcessor.java @@ -130,11 +130,14 @@ public String getPageTitle(Path path) { throw new IllegalStateException("Unable to read page title !", e); } try { + String title = ""; if (isAdoc(path)) { - return asciidoctor.load(pageContent, options).getStructuredDoctitle().getMain(); + title = asciidoctor.load(pageContent, options).getStructuredDoctitle().getMain(); + } else { + // try to read h1 tag + title = tagText(pageContent, "h1"); } - // try to read h1 tag - return tagText(pageContent, "h1"); + return StringEscapeUtils.unescapeHtml4(title); } catch (IllegalStateException e) { return FilenameUtils.removeExtension(path.getFileName().toString()); } diff --git a/livingdoc-maven-plugin/src/test/java/ch/ifocusit/livingdoc/plugin/publish/HtmlPostProcessorTest.java b/livingdoc-maven-plugin/src/test/java/ch/ifocusit/livingdoc/plugin/publish/HtmlPostProcessorTest.java index 148ee2c..4820891 100644 --- a/livingdoc-maven-plugin/src/test/java/ch/ifocusit/livingdoc/plugin/publish/HtmlPostProcessorTest.java +++ b/livingdoc-maven-plugin/src/test/java/ch/ifocusit/livingdoc/plugin/publish/HtmlPostProcessorTest.java @@ -1,11 +1,9 @@ package ch.ifocusit.livingdoc.plugin.publish; import ch.ifocusit.livingdoc.plugin.baseMojo.AbstractAsciidoctorMojo; -import ch.ifocusit.livingdoc.plugin.publish.confluence.PlantumlMacroBlockProcessor; import org.asciidoctor.Asciidoctor; import org.asciidoctor.Attributes; import org.asciidoctor.Options; -import org.asciidoctor.extension.JavaExtensionRegistry; import org.junit.jupiter.api.Test; import org.junit.jupiter.api.extension.ExtendWith; import org.mockito.junit.jupiter.MockitoExtension; From 70c781e851250e02cc6817d7f39c40bbe2764a18 Mon Sep 17 00:00:00 2001 From: Julien Boz Date: Fri, 1 Dec 2023 11:26:29 +0100 Subject: [PATCH 2/2] upgrade version manually --- livingdoc-examples/aggregate/aggregate-cargo/pom.xml | 2 +- livingdoc-examples/aggregate/aggregate-handling/pom.xml | 2 +- livingdoc-examples/aggregate/aggregate-location/pom.xml | 2 +- livingdoc-examples/aggregate/aggregate-shared/pom.xml | 2 +- livingdoc-examples/aggregate/aggregate-sharedhandling/pom.xml | 2 +- livingdoc-examples/aggregate/aggregate-voyage/pom.xml | 2 +- livingdoc-examples/aggregate/aggregate-zz-livingdoc/pom.xml | 2 +- livingdoc-examples/aggregate/pom.xml | 2 +- livingdoc-examples/ddd-annotated/pom.xml | 2 +- livingdoc-examples/ddd/pom.xml | 2 +- livingdoc-examples/microservice/pom.xml | 2 +- livingdoc-examples/pom.xml | 2 +- livingdoc-maven-plugin/pom.xml | 2 +- 13 files changed, 13 insertions(+), 13 deletions(-) diff --git a/livingdoc-examples/aggregate/aggregate-cargo/pom.xml b/livingdoc-examples/aggregate/aggregate-cargo/pom.xml index 8698a19..ef5bff2 100644 --- a/livingdoc-examples/aggregate/aggregate-cargo/pom.xml +++ b/livingdoc-examples/aggregate/aggregate-cargo/pom.xml @@ -7,7 +7,7 @@ ch.ifocusit.livingdoc.example aggregate - 2.5-SNAPSHOT + 2.6-SNAPSHOT aggregate-cargo diff --git a/livingdoc-examples/aggregate/aggregate-handling/pom.xml b/livingdoc-examples/aggregate/aggregate-handling/pom.xml index 9fb6c95..80f150a 100644 --- a/livingdoc-examples/aggregate/aggregate-handling/pom.xml +++ b/livingdoc-examples/aggregate/aggregate-handling/pom.xml @@ -7,7 +7,7 @@ ch.ifocusit.livingdoc.example aggregate - 2.5-SNAPSHOT + 2.6-SNAPSHOT aggregate-handling diff --git a/livingdoc-examples/aggregate/aggregate-location/pom.xml b/livingdoc-examples/aggregate/aggregate-location/pom.xml index 006faf0..745bd3a 100644 --- a/livingdoc-examples/aggregate/aggregate-location/pom.xml +++ b/livingdoc-examples/aggregate/aggregate-location/pom.xml @@ -7,7 +7,7 @@ ch.ifocusit.livingdoc.example aggregate - 2.5-SNAPSHOT + 2.6-SNAPSHOT aggregate-location diff --git a/livingdoc-examples/aggregate/aggregate-shared/pom.xml b/livingdoc-examples/aggregate/aggregate-shared/pom.xml index af806e6..55096ce 100644 --- a/livingdoc-examples/aggregate/aggregate-shared/pom.xml +++ b/livingdoc-examples/aggregate/aggregate-shared/pom.xml @@ -7,7 +7,7 @@ ch.ifocusit.livingdoc.example aggregate - 2.5-SNAPSHOT + 2.6-SNAPSHOT aggregate-shared diff --git a/livingdoc-examples/aggregate/aggregate-sharedhandling/pom.xml b/livingdoc-examples/aggregate/aggregate-sharedhandling/pom.xml index bb68612..28a6a61 100644 --- a/livingdoc-examples/aggregate/aggregate-sharedhandling/pom.xml +++ b/livingdoc-examples/aggregate/aggregate-sharedhandling/pom.xml @@ -7,7 +7,7 @@ ch.ifocusit.livingdoc.example aggregate - 2.5-SNAPSHOT + 2.6-SNAPSHOT aggregate-sharedhandling diff --git a/livingdoc-examples/aggregate/aggregate-voyage/pom.xml b/livingdoc-examples/aggregate/aggregate-voyage/pom.xml index 3201ffa..10fa0b7 100644 --- a/livingdoc-examples/aggregate/aggregate-voyage/pom.xml +++ b/livingdoc-examples/aggregate/aggregate-voyage/pom.xml @@ -7,7 +7,7 @@ ch.ifocusit.livingdoc.example aggregate - 2.5-SNAPSHOT + 2.6-SNAPSHOT aggregate-voyage diff --git a/livingdoc-examples/aggregate/aggregate-zz-livingdoc/pom.xml b/livingdoc-examples/aggregate/aggregate-zz-livingdoc/pom.xml index 4f6f80b..826a821 100644 --- a/livingdoc-examples/aggregate/aggregate-zz-livingdoc/pom.xml +++ b/livingdoc-examples/aggregate/aggregate-zz-livingdoc/pom.xml @@ -7,7 +7,7 @@ ch.ifocusit.livingdoc.example aggregate - 2.5-SNAPSHOT + 2.6-SNAPSHOT aggregate-zz-livingdoc diff --git a/livingdoc-examples/aggregate/pom.xml b/livingdoc-examples/aggregate/pom.xml index 1e9f2e7..d841571 100644 --- a/livingdoc-examples/aggregate/pom.xml +++ b/livingdoc-examples/aggregate/pom.xml @@ -7,7 +7,7 @@ ch.ifocusit.livingdoc.example livingdoc-examples - 2.5-SNAPSHOT + 2.6-SNAPSHOT aggregate diff --git a/livingdoc-examples/ddd-annotated/pom.xml b/livingdoc-examples/ddd-annotated/pom.xml index 32bd8a8..d3084ec 100644 --- a/livingdoc-examples/ddd-annotated/pom.xml +++ b/livingdoc-examples/ddd-annotated/pom.xml @@ -6,7 +6,7 @@ ch.ifocusit.livingdoc.example livingdoc-examples - 2.5-SNAPSHOT + 2.6-SNAPSHOT ddd-annotated diff --git a/livingdoc-examples/ddd/pom.xml b/livingdoc-examples/ddd/pom.xml index 7ce9aaa..62284df 100644 --- a/livingdoc-examples/ddd/pom.xml +++ b/livingdoc-examples/ddd/pom.xml @@ -6,7 +6,7 @@ ch.ifocusit.livingdoc.example livingdoc-examples - 2.5-SNAPSHOT + 2.6-SNAPSHOT ddd diff --git a/livingdoc-examples/microservice/pom.xml b/livingdoc-examples/microservice/pom.xml index 3e684a1..adf9b0c 100644 --- a/livingdoc-examples/microservice/pom.xml +++ b/livingdoc-examples/microservice/pom.xml @@ -5,7 +5,7 @@ ch.ifocusit.livingdoc.example livingdoc-examples - 2.5-SNAPSHOT + 2.6-SNAPSHOT microservice jar diff --git a/livingdoc-examples/pom.xml b/livingdoc-examples/pom.xml index 2c3b526..b10b6ca 100644 --- a/livingdoc-examples/pom.xml +++ b/livingdoc-examples/pom.xml @@ -5,7 +5,7 @@ ch.ifocusit.livingdoc.example livingdoc-examples - 2.5-SNAPSHOT + 2.6-SNAPSHOT pom Living Documentation example diff --git a/livingdoc-maven-plugin/pom.xml b/livingdoc-maven-plugin/pom.xml index f6cb617..adf6e45 100644 --- a/livingdoc-maven-plugin/pom.xml +++ b/livingdoc-maven-plugin/pom.xml @@ -5,7 +5,7 @@ ch.ifocusit.livingdoc livingdoc-maven-plugin - 2.5-SNAPSHOT + 2.6-SNAPSHOT maven-plugin Living Documentation maven plugin