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

fix: specifying ids on elements (named destinations) #2549

Merged
merged 3 commits into from
Jan 23, 2024

Conversation

carlobeltrame
Copy link
Contributor

Fixes 36c6ba3#r137623912

Unfortunately I can't provide a REPL, because the REPL seems to run react-pdf in an older version. The bug was introduced in @react-pdf/[email protected] and led to our CI failure in ecamp/ecamp3#4495

Instead of a REPL, I added a regression test which at least uses the id attribute (with a non-number value). Running this test with 3.1.1 would yield the error unsupported number: NaN. This is because the name_tree class was wrongly changed to use parseInt instead of new String() in 36c6ba3.

In 36c6ba3, the contents of pdfkit
number_tree were mistakenly copied over react-pdf's copy of name_tree.
These two files contain different classes: number_tree is used for
marked content sequences, while name_tree is used for named
destinations and embedded files.
Copy link

changeset-bot bot commented Jan 23, 2024

🦋 Changeset detected

Latest commit: 34b6ffe

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 5 packages
Name Type
@react-pdf/pdfkit Patch
@react-pdf/layout Patch
@react-pdf/renderer Patch
@react-pdf/svgkit Patch
@react-pdf/examples Patch

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

@diegomura diegomura changed the title Fix specifying ids on elements (named destinations) fix: specifying ids on elements (named destinations) Jan 23, 2024
Copy link
Owner

@diegomura diegomura left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

utACK

Thanks!

@diegomura diegomura merged commit 44bd45b into diegomura:master Jan 23, 2024
1 check passed
@carlobeltrame carlobeltrame deleted the fix-named-destinations branch January 23, 2024 12:33
mskec pushed a commit to mskec/react-pdf that referenced this pull request Feb 26, 2024
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.

2 participants