openlibhums / janeway

A web-based platform for publishing journals, preprints, conference proceedings, and books
https://janeway.systems/
GNU Affero General Public License v3.0
168 stars 63 forks source link

Figure <label> doesn't render unless there's also a <title> #2657

Open pgoussy opened 2 years ago

pgoussy commented 2 years ago

Describe the bug A figure whose only caption is "Figure 1" (without additional text beyond this numerical label) was not displaying any caption text at all in Janeway.

To Reproduce Steps to reproduce the behavior:

  1. Go to https://journals.publishing.umich.edu/ergo/plugins/typesetting/preview_galley/article/1125/galley/424/#F1
  2. Link should go directly to Figure 1; if not, click on "Veridical versus Deceptive States and Their Associated Credences" and scroll down until you see an image.
  3. Notice that there is no "Figure 1" label/caption box displaying under the image, even though it's tagged properly in the JATS.
<fig id="F1" position="anchor">
<label>Figure 1</label>
<graphic xmlns:xlink="http://www.w3.org/1999/xlink" xlink:href="ergo-1125-f0001.jpg"/>
</fig>

As an experiment, I tried a few alternative taggings:

<caption><label>Figure 1</label></caption>

Surrounding the <label> with <caption> tags didn't change anything.

<label>Figure 1</label>
<caption><title>test</title></caption>

Adding a <title> successfully caused the shaded caption box to appear, displaying both the <title> text and the <label> text

Expected behavior Figure label should display in a caption box, even if there isn't additional caption text present.

pgoussy commented 2 years ago

Bumping up because this seems tangentially related to #2911 which I just reported.