Skip to content

Commit

Permalink
fix: note rendering (#2951)
Browse files Browse the repository at this point in the history
* fix: note rendering

* Create unlucky-coats-crash.md
  • Loading branch information
diegomura authored Nov 17, 2024
1 parent 77e480c commit aab7d95
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 1 deletion.
5 changes: 5 additions & 0 deletions .changeset/unlucky-coats-crash.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@react-pdf/renderer": patch
---

fix: note rendering
6 changes: 5 additions & 1 deletion packages/renderer/src/renderer.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,11 @@ const createTextInstance = (text) => ({ type: 'TEXT_INSTANCE', value: text });

const appendChild = (parent, child) => {
const isParentText =
parent.type === 'TEXT' || parent.type === 'LINK' || parent.type === 'TSPAN';
parent.type === 'TEXT' ||
parent.type === 'LINK' ||
parent.type === 'TSPAN' ||
parent.type === 'NOTE';

const isChildTextInstance = child.type === 'TEXT_INSTANCE';
const isOrphanTextInstance = isChildTextInstance && !isParentText;

Expand Down

0 comments on commit aab7d95

Please sign in to comment.