Skip to content

Link an empty or top fragment to the first page of the PDF - #298

Merged
eXpl0it3r merged 1 commit into
masterfrom
fix/pdf-empty-fragment-link
Nov 23, 2026
Merged

eXpl0it3r merged 1 commit into
masterfrom
fix/pdf-empty-fragment-link

Conversation

@eXpl0it3r

Copy link
Copy Markdown
Collaborator

Description

A link with href="#" threw an ArgumentNullException in PdfGenerator.HandleLinks, as the empty fragment was passed on to GetElementRectangle. Per HTML 7.4.6.4 an empty fragment, as well as top without an element of that id, points to the top of the document, so these links now go to the first page of the PDF.

Closes #176

How to test this PR?

CI should succeed.

@eXpl0it3r
eXpl0it3r merged commit 4db50ae into master Nov 23, 2026
12 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Error with empty anchors

1 participant