Skip to content
New issue

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

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

Already on GitHub? # to your account

Show the corresponding element when noheader is true #20

Open
mcruzdev opened this issue Aug 16, 2024 · 2 comments
Open

Show the corresponding element when noheader is true #20

mcruzdev opened this issue Aug 16, 2024 · 2 comments

Comments

@mcruzdev
Copy link

          I have a doubt, I am working on this [pull request](https://github.com/quarkiverse/quarkus-qute-web/pull/102) to make a PoC with this tooling (thank you for this great job)!

I have a test here:

    @Test
    public void testH1() {
        Engine engine = Engine.builder().addDefaults()
                .addSectionHelper(new AsciidocSectionHelperFactory()).build();

        String result = engine.parse("{#ascii}= Quarkus and Roq{/ascii}").render();

        assertThat(result).contains("<h1>Quarkus and Roq</h1>");
    }

The result is "" but the expected is to have <h1>..., It happens when I add noheader attribute, is it the expected behavior?

I think it should be <h1>... no?

Originally posted by @mcruzdev in #18 (comment)

@rmannibucau
Copy link
Contributor

rmannibucau commented Aug 16, 2024

Seems it is right for asciidoctor (https://github.com/asciidoctor/asciidoctor/blob/main/lib/asciidoctor/converter/html5.rb#L193) but we also consider noheader there (https://github.com/yupiik/tools-maven-plugin/blob/master/asciidoc-java/src/main/java/io/yupiik/asciidoc/renderer/html/AsciidoctorLikeHtmlRenderer.java#L299).
We should probably add to the configuration a backward compatible toggle to keep current behavior since the reasoning was that when embed the title (=) was managed by the embedder and not the renderer.

One way is to consider the notitle value instead of just testing the presence maybe? if false we use it whatever noheader is?

@fpapon
Copy link
Member

fpapon commented Nov 21, 2024

@mcruzdev is this issue still relevant? Can we close it?

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

Successfully merging a pull request may close this issue.

3 participants