Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Export PDF produces different HTML than Export HTML. #384

Open
raiden-e opened this issue Sep 27, 2024 · 1 comment
Open

Export PDF produces different HTML than Export HTML. #384

raiden-e opened this issue Sep 27, 2024 · 1 comment

Comments

@raiden-e
Copy link

So I found this out when I noticed that some styles from my local CSS were only applied in the browser, and not in the PDF (or JPG).

Here is a short test .md file with some html:

<div class="title">

# this is a test document

According to the css, this text should be written in the font "Inter".

</div>

# However

this text should be written in the font "Comic Sans MS".

The Browser displays the texts as expected.

The PDF does not. Nor does a jpeg of the PDF.

Apply this CSS:

body { font-family: "Comic Sans MS"; }
.title p { font-family: "Inter"; }

In the "Export HTML"-HTML, the div with the class "test" is closed by the </div>.

When running the export PDF command, a temporary HTML is produced. I renamed it, before the process could finish and found that for whatever reason, the div was closed immediately, leading unstyled, uncool text.

Here is the result (I got it from the files I tested it with, so the content is a bit different, the main part is the immediately closed div container):

<div class="title">
</div><h1 id="hauptseite">Hauptseite</h1>
<p>Dies ist die Titelseite. Dieser Text wird in der Schrift &quot;Inter&quot; geschrieben.</p>

Perhaps a different export function is used, or the export function has other caveats?

Please help 👍

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants
@raiden-e and others