Skip to content

Commit

Permalink
Merge pull request #149 from ia3andy/fix-raw-string
Browse files Browse the repository at this point in the history
Fix RawString issue with Asciidoc and Markdown template extensions
  • Loading branch information
mkouba authored Jan 15, 2025
2 parents 2e047eb + e94aa89 commit b2f7a9a
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@

import io.quarkus.qute.CompletedStage;
import io.quarkus.qute.EngineConfiguration;
import io.quarkus.qute.RawString;
import io.quarkus.qute.ResultNode;
import io.quarkus.qute.SectionHelper;
import io.quarkus.qute.SectionHelperFactory;
Expand All @@ -29,8 +30,8 @@ public AsciidocSectionHelper initialize(SectionInitContext context) {
}

@TemplateExtension(matchNames = { "asciidocify", "asciidocToHtml" })
static String convertToAsciidoc(String text, String ignoredName) {
return CONVERTER.apply(text);
static RawString convertToAsciidoc(String text, String ignoredName) {
return new RawString(CONVERTER.apply(text));
}

public static class AsciidocSectionHelper implements SectionHelper {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
import io.quarkus.arc.impl.LazyValue;
import io.quarkus.qute.CompletedStage;
import io.quarkus.qute.EngineConfiguration;
import io.quarkus.qute.RawString;
import io.quarkus.qute.ResultNode;
import io.quarkus.qute.SectionHelper;
import io.quarkus.qute.SectionHelperFactory;
Expand Down Expand Up @@ -47,8 +48,8 @@ public MarkdownSectionHelper initialize(SectionInitContext context) {
() -> Arc.container().instance(MdConverter.class).get());

@TemplateExtension(matchNames = { "markdownify", "mdToHtml" })
static String convertToMarkdown(String text, String ignoredName) {
return CONVERTER.get().html(text);
static RawString convertToMarkdown(String text, String ignoredName) {
return new RawString(CONVERTER.get().html(text));
}

public static class MarkdownSectionHelper implements SectionHelper {
Expand Down

0 comments on commit b2f7a9a

Please sign in to comment.