Skip to content

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

Open
eXpl0it3r wants to merge 1 commit into
masterfrom
fix/pdf-empty-fragment-link
Open

eXpl0it3r wants to merge 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.

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

Successfully merging this pull request may close these issues.

Error with empty anchors

1 participant