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

Link to specific page of PDF gets garbled #1022

Closed
wjdenny opened this issue Mar 22, 2024 · 1 comment · Fixed by #1025
Closed

Link to specific page of PDF gets garbled #1022

wjdenny opened this issue Mar 22, 2024 · 1 comment · Fixed by #1025
Labels
bug Something isn't working

Comments

@wjdenny
Copy link

wjdenny commented Mar 22, 2024

When linking to a specific page in a PDF file using a page specifier gets changed in the Quartz website output, removing the = between page and the page number.

To reproduce
In a Markdown file with contents:

[this paper](file.pdf#page=5)

the contents gets transformed to:

<a href="./file.pdf#page5" class="internal alias" data-slug="file.pdf">this paper</a>

Note the missing = between page and 5 in the output HTML.

Expected behavior
Expected output would be the full link without changing the URL.

<a href="./file.pdf#page=5" class="internal alias" data-slug="file.pdf">this paper</a>
  • Quartz Version: 4.2.3
  • node Version: 21.6.2
  • npm version: 10.5.0
  • OS: Debian 12
  • Browser: Mozilla Firefox 123.0.1
@wjdenny wjdenny added the bug Something isn't working label Mar 22, 2024
@saberzero1
Copy link
Collaborator

Hey @wjdenny,

Thanks for opening this issue.

It seems #page=[page number] for PDFs is widely supported on modern desktop browsers. Mobile support seems a bit lower, depending on the source, especially on iOS devices.

Additionally, the #page=[page number] seems to be ignored if the PDF has been opened previously. In that case, it tends to head to the last viewed page. This seems to be intended browser caching behavior.

I'll open a pull request shortly to correct this issue.

I'll have to look into the caching behavior later if we decide to override page linking. Although I suppose implementing this behavior might be confusing for users as it is different from the default.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants