Skip to content

Commit

Permalink
chore(confluence) 🐝 manage special characters in the page title
Browse files Browse the repository at this point in the history
  • Loading branch information
Julien Boz committed Dec 1, 2023
1 parent c0d2e46 commit 552ef03
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 6 deletions.
Original file line number Diff line number Diff line change
@@ -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.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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());
}
Expand Down
Original file line number Diff line number Diff line change
@@ -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;
Expand Down

0 comments on commit 552ef03

Please sign in to comment.