Skip to content

Newline after <sup> and <em> elements in generated html creates formatting error on display #17

Description

@hachacha

Currently running 44d1fda

This is it after rendered fully, note the spaces and weird underlines

image

When looking at the html file it appears like this for both <sup> and <em> elements:

image

After removing the new lines from the html galley file directly, the page renders properly with no weird spacing around the sup or emphasis elements.

I tried to debug this to figure out where it's coming from. I checked the output from pandoc because that would make sense since it's these elements specifically giving issue, but don't see anything in stdout:

From Isidore\xe2\x80\x99s <em>Etymologies</em> (12<sup>th</sup> century), original located at the British Library (shelfmark: Royal 12 F. IV, f.135v).</p>\n<p>The idea of the impossibility of life in the southern hemisphere (virtually lying on the back side of traditional T-O maps)<a href="#fn4" class="footnoteRef" id="fnref4"><sup>4</sup></a> derived from the theory of climate zones, first described by Macrobius in the 5<sup>th</sup>

I tried various ways of printing out from beautiful soup but that also seems about the same.

so I thought it may be from trying to write to the file but changing the newline attribute and replacing these things in the string in views.py still does not help

with open(output_path, mode="w", encoding="utf-8", newline='') as html_file:
        print(html.replace("\r","").replace('\n',''), file=html_file)

any help or guidance with this would be greatly appreciated.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions