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

<sec> <label> doesn't display as section heading or TOC link unless <title> is also populated #2911

Open pgoussy opened 2 years ago

pgoussy commented 2 years ago

Describe the bug Occasionally, an article will be divided into subsections that are only labeled numerically--no further section title is present. In its most basic form, this could be tagged in the JATS as follows:

<sec id="S1">
<label>1.</label>

Evidently, Janeway requires to be populated in order to display a section heading in the flow of text or a link on the floating TOC. Inspecting the HTML reveals that the article <em>is</em> divided into separate <code><div></code>s corresponding to the JATS <code><sec></code> tags as expected, but the text contained in the JATS <code><label></code> has disappeared entirely.</p> <p>Our XML vendor tagged these particular sections with empty <code><title></code> tags accompanying the <code><label></code> tags:</p> <pre><code><sec id="S1"> <label>1.</label><title></title></code></pre> <p>It appears that a completely empty <code><title></code> tag is still insufficient to force the <code><label></code> to display as a section heading. However, I did determine a straightforward workaround: adding a blank space character into the previously-empty <code><title></code></p> <pre><code><sec id="S1"> <label>1.</label><title> </title></code></pre> <p>This does successfully cause the <code><label></code> to display as <code><h2></code> and appear on the floating TOC. <strong>Janeway version</strong> 1.4.1</p> <p><strong>To Reproduce</strong> Steps to reproduce the behavior:</p> <ol> <li>Go to <a rel="noreferrer nofollow" target="_blank" href="https://journals.publishing.umich.edu/ergo/plugins/typesetting/preview_galley/article/1120/galley/419/">https://journals.publishing.umich.edu/ergo/plugins/typesetting/preview_galley/article/1120/galley/419/</a></li> <li>Scroll past the epigraph quotes at the begining of the article body.</li> <li>A section heading "1." should appear immediately before the paragraph beginning "I believe in moral obligation...", but at the time of writing, it does not.</li> </ol> <p><strong>Expected behavior</strong> A tagged section label should render in the HMTL (as a visible section heading and as a link on the TOC) regardless of whether it is followed by additional title text.</p> <p><strong>Screenshots</strong> Here's how the HTML renders with the JATS as we received it: <img referrerpolicy="no-referrer" src="https://user-images.githubusercontent.com/36245100/172704966-65964026-73e5-4eec-96cf-6d98eab21849.png" alt="label_as-delivered" /> And here's the HTML after I added a space into the empty <code><title></code> tag as a workaround: <img referrerpolicy="no-referrer" src="https://user-images.githubusercontent.com/36245100/172704983-b1bf77c2-762f-4293-84ec-003129efd04f.png" alt="label_workaround" /></p> </div> </div> <div class="comment"> <div class="user"> <a rel="noreferrer nofollow" target="_blank" href="https://github.com/pgoussy"><img src="https://avatars.githubusercontent.com/u/36245100?v=4" />pgoussy</a> commented <strong> 1 year ago</strong> </div> <div class="markdown-body"> <p>Bumping this up because it just came up again in a new issue.</p> </div> </div> <div class="page-bar-simple"> </div> <div class="footer"> <ul class="body"> <li>© <script> document.write(new Date().getFullYear()) </script> Githubissues.</li> <li>Githubissues is a development platform for aggregating issues.</li> </ul> </div> <script src="https://cdn.jsdelivr.net/npm/jquery@3.5.1/dist/jquery.min.js"></script> <script src="/githubissues/assets/js.js"></script> <script src="/githubissues/assets/markdown.js"></script> <script src="https://cdn.jsdelivr.net/gh/highlightjs/cdn-release@11.4.0/build/highlight.min.js"></script> <script src="https://cdn.jsdelivr.net/gh/highlightjs/cdn-release@11.4.0/build/languages/go.min.js"></script> <script> hljs.highlightAll(); </script> </body> </html>