macmillanpublishers / htmlmaker_js

Repo for testing and finalizing htmlmaker javascript implementation
0 stars 1 forks source link

figure elements ordered differently in html, bad pdf output #61

Closed mattretzer closed 7 years ago

mattretzer commented 7 years ago

(Encountered when testing with our test manuscript)

There's a fullpage illustration near the end of Chapter 2 in our test manuscript. Here's how it's styled: screen shot 2017-06-06 at 3 34 15 pm

In the xsl html: the image is inserted before the caption within the figure block

<figure id="fig-d1e2041" class="Illustrationholderill">
    <img src="images/dragons-fantasy_fullpage.jpg" alt="This is a caption above an image." />
    <figcaption class="Captioncap">This is a caption above an image.</figcaption>
    <p class="IllustrationSourceis"><a class="fig-link">Image courtesy of some great wizard</a></p>
</figure>

In the js html, the caption is inserted before the img element. This is wreaking some havoc in the pdf output; I think the order matters here.

<figure class="Illustrationholderill" id="fig-idmxl22pb0q">
    <p class="Captioncap" id="idrlp57rjym">This is a caption above an image.</p>
    <img src="images/dragons-fantasy_fullpage.jpg" alt="This%20is%20a%20caption%20above%20an%20image." />
    <p class="IllustrationSourceis" id="idjvdfx3nxz"><a class="fig-link">Image courtesy of some great wizard</a></p>
</figure>
mattretzer commented 7 years ago

Note: when testing to make sure element order mattered, I manually edited the js html to change the caption to a <figcaption> element instead of a <p> to make sure that wasn't the issue

mattretzer commented 7 years ago

This is in htmltohtmlbook.js.

MacmillanWorkflows commented 7 years ago

➤ Matthew Retzer commented:

This PR resolves this issue: https://github.com/macmillanpublishers/htmlmaker_js/pull/65

MacmillanWorkflows commented 7 years ago

➤ Matthew Retzer commented:

approved with minor edit request; edit made, merged