Skip to content

Commit

Permalink
Add support for new line in description (#210)
Browse files Browse the repository at this point in the history
* Add support for new line in description

* Add changeset
  • Loading branch information
sboulema authored Nov 1, 2023
1 parent 7ced699 commit 6db06b3
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 2 deletions.
5 changes: 5 additions & 0 deletions .changeset/quiet-mugs-sort.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'socialify': minor
---

Support new line in description
2 changes: 1 addition & 1 deletion src/components/preview/__snapshots__/card.test.tsx.snap
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@ exports[`Card #2 renders 1`] = `
</p>
<p
class="card-description-wrapper"
style="display: flex; justify-content: center; width: 100%; margin-top: 10px; margin-bottom: 0px; font-size: 17px; line-height: 1.4; max-height: 3em; overflow: hidden; word-break: break-all;"
style="display: flex; justify-content: center; width: 100%; margin-top: 10px; margin-bottom: 0px; font-size: 17px; line-height: 1.4; max-height: 3em; overflow: hidden; word-break: break-all; white-space: pre-wrap;"
>
TEST DESCRIPTION
</p>
Expand Down
3 changes: 2 additions & 1 deletion src/components/preview/card.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -143,7 +143,8 @@ export const Card = (config: Configuration) => {
lineHeight: 1.4,
maxHeight: '3em',
overflow: 'hidden',
wordBreak: 'break-all'
wordBreak: 'break-all',
whiteSpace: 'pre-wrap'
}}>
{config.description.value}
</p>
Expand Down

1 comment on commit 6db06b3

@vercel
Copy link

@vercel vercel bot commented on 6db06b3 Nov 1, 2023

Choose a reason for hiding this comment

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

Please sign in to comment.