Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix RawString issue with Asciidoc and Markdown template extensions #149

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

ia3andy
Copy link
Contributor

@ia3andy ia3andy commented Dec 20, 2024

Fixes #146

@ia3andy ia3andy requested a review from a team as a code owner December 20, 2024 09:40
@ia3andy ia3andy requested a review from jtama December 20, 2024 09:41
Copy link
Member

@jtama jtama left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, though I don't think using wildcard for imports will make it.

import io.quarkus.qute.SectionHelperFactory;
import io.quarkus.qute.SingleResultNode;
import io.quarkus.qute.TemplateExtension;
import io.quarkus.qute.*;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pls don't use wildcards for imports.

@@ -29,8 +23,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) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

How does it fix the problem with section params in #146?

IIUIC this merely changes the behavior of {text.asciidocToHtml} in a way that it corresponds to {text.asciidocToHtml.raw}. Which is probably ok, unless someone wants to escape the result of conversion... which probably does not make a lot of sense, right?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What I was trying to achieve with an attribute was to prevent the the rendered content of beeing escaped. So if we have another to achieve the same it's fine.
It may be still be of some use to be able to pass attributes to the section but this would be a good start.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

asciidoc section help ignores parameters
3 participants