Skip to content

Commit

Permalink
FIX: spread props in heading elements (#37)
Browse files Browse the repository at this point in the history
* fix: spread props in heading elements

* Create late-pugs-tap.md

* changeset

* fix

---------

Co-authored-by: Julian Benegas <[email protected]>
  • Loading branch information
Joaquín R. Montes and julianbenegas authored Dec 15, 2023
1 parent 2488737 commit 374061a
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 6 deletions.
9 changes: 9 additions & 0 deletions .changeset/shaggy-chairs-lie.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
---
"basehub": patch
---

---

## "basehub": patch

Headings now receive their `id` when using the default handlers for them
12 changes: 6 additions & 6 deletions packages/basehub/src/react/rich-text/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -242,12 +242,12 @@ const defaultHandlers: Handlers = {
</li>
);
},
h1: ({ children }) => <h1>{children}</h1>,
h2: ({ children }) => <h2>{children}</h2>,
h3: ({ children }) => <h3>{children}</h3>,
h4: ({ children }) => <h4>{children}</h4>,
h5: ({ children }) => <h5>{children}</h5>,
h6: ({ children }) => <h6>{children}</h6>,
h1: ({ children, ...props }) => <h1 {...props}>{children}</h1>,
h2: ({ children, ...props }) => <h2 {...props}>{children}</h2>,
h3: ({ children, ...props }) => <h3 {...props}>{children}</h3>,
h4: ({ children, ...props }) => <h4 {...props}>{children}</h4>,
h5: ({ children, ...props }) => <h5 {...props}>{children}</h5>,
h6: ({ children, ...props }) => <h6 {...props}>{children}</h6>,
hr: () => <hr />,
img: (props) => <img {...props} />,
video: (props) => <video {...props} />,
Expand Down

0 comments on commit 374061a

Please sign in to comment.