chirun-ncl / chirun

A Python package providing the command line interface for building flexible and accessible content with Chirun.
https://chirun.org.uk/
Other
29 stars 4 forks source link

Markdown image order #233

Open prowlett opened 2 months ago

prowlett commented 2 months ago

If I have a Markdown file like this:

# Some images

![1](1.png)![2](2.png)![3](3.png)![4](4.png)

The VSCodium Markdown preview looks like this:

image

The output from chirun looks like this

image

I don't know why there is so much white space, nor why the images are out of sequence.

The rendered HTML has three of the images places in <figure> environments and the other isn't. I don't understand <figure> but I guess these might float? But the order in the HTML is 2,1,4,3, which seems strange.

    <article class="item-content" id="item-content">
        <section>
<h1 id="some_images">Some images</h1>
<p><img alt="2" src="images/2.png"/></p>
<figure class="figure1" data-title="1"><img alt="1" src="images/1.png"/></figure><p><img alt="4" src="images/4.png"/></p><figure class="figure3" data-title="3"><img alt="3" src="images/3.png"/></figure>
</section>

    </article>

I tried both Firefox and Chromium on Ubuntu.

(My workaround for the real version of this was that I edited the row of images into a single image.)

christianp commented 2 months ago

That's really weird!

I've made a really simple test case at https://lti.chirun.org.uk/media/chirun-packages/output/80e35e42-c541-46bd-8fa7-d5a054ec0820/untitled_chapter/index.html.

Putting space characters between the images doesn't help, nor does a single newline. At least it looks correct when each image is in its own paragraph.