jbake-org / jbake

Java based open source static site/blog generator for developers & designers.
http://jbake.org
MIT License
1.12k stars 326 forks source link

White space handling appears to have changed in 2.6.0 #445

Open jonbullock opened 6 years ago

jonbullock commented 6 years ago

Reported on dev mailing list: https://groups.google.com/d/topic/jbake-dev/-eznqm_5zPQ/discussion

Sample content:

= Sometitle
Jonathan Bullock
2013-10-17
:jbake-last_updated: 2017-06-01
:jbake-author: Jonathan Bullock
:jbake-type: post
:jbake-status: published
:jbake-tags: blog, asciidoc

[.myblock]
Lots of blabla about +++<!-- PREVIEW-SUFFIX --><!-- </p></li></ul></div> --><!-- PREVIEW-END -->+++ nothing really interesting.

Produces the following output using AsciidoctorJ 1.5.6 directly:

<div class="paragraph myblock">
<p>Lots of blabla about <!-- PREVIEW-SUFFIX --><!-- </p></li></ul></div> --><!-- PREVIEW-END --> nothing really interesting.</p>
</div>

But produces this output in JBake 2.6.0:

       <div class="paragraph myblock"> 
 <p>Lots of blabla about 
  <!-- PREVIEW-SUFFIX -->
  <!-- </p></li></ul></div> -->
  <!-- PREVIEW-END --> nothing really interesting.</p> 
</div>

Used to produce this output in JBake 2.5.1:

<div class="paragraph myblock">
<p>Lots of blabla about <!-- PREVIEW-SUFFIX --><!-- </p></li></ul></div> --><!-- PREVIEW-END --> nothing really interesting.</p>
</div>
ancho commented 6 years ago

Hmm. This is more a cosmetical issue isn't it?

                            <div class="columns">
                                <div class="paragraph myblock"> 
 <p>Lots of blabla about 
  <!-- PREVIEW-SUFFIX -->
  <!-- </p></li></ul></div> -->
  <!-- PREVIEW-END --> nothing really interesting.</p> 
</div>
                            </div>

Yes. It looks a bit strange. But it has no influence on the rendered output in the browser.

Anyways I wrote a little test in ParserTest which does not fail. So it's maybe in the renderer.

    @Test
    public void shouldRenderHtmlAsExpected() throws Exception {

        validAsciiDocFileWithoutJBakeMetaData = folder.newFile("validwojbakemetadata.adoc");
        PrintWriter out = new PrintWriter(validAsciiDocFileWithoutJBakeMetaData);
        out.println("= Hello: AsciiDoc!");
        out.println("Test User <user@test.org>");
        out.println("2013-09-02");
        out.println(":jbake-status: published");
        out.println(":jbake-type: page");
        out.println("");
        out.println("[.myblock]");
        out.println("Lots of blabla about +++<!-- PREVIEW-SUFFIX --><!-- </p></li></ul></div> --><!-- PREVIEW-END -->+++ nothing really interesting.");
        out.close();

        Map<String, Object> map = parser.processFile(validAsciiDocFileWithoutJBakeMetaData);

        assertThat(map.get("body").toString())
                .contains("<div class=\"paragraph myblock\">\n" +
                        "<p>Lots of blabla about <!-- PREVIEW-SUFFIX --><!-- </p></li></ul></div> --><!-- PREVIEW-END --> nothing really interesting.</p>\n" +
                        "</div>");

    }

The markfown output changed a bit when we switched to flexmark if I remember right.

jonbullock commented 6 years ago

Yeah it is a cosmetic issue, I logged it down as it was something that changed in 2.6.0, I thought it was probably AsciidoctorJ since we'd upgraded in 2.6.0 but my testing suggested it wasn't.

Wanted to understand what has caused the output to change.