-
Notifications
You must be signed in to change notification settings - Fork 156
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(card): ensure copy can render markdown #7871
fix(card): ensure copy can render markdown #7871
Conversation
Deploy preview created for package Built with commit: e1680836dc7391e62ac1f23e5702b9eeda5b78b8 |
Deploy preview created for package Built with commit: e1680836dc7391e62ac1f23e5702b9eeda5b78b8 |
Deploy preview created for package Built with commit: e1680836dc7391e62ac1f23e5702b9eeda5b78b8 |
Deploy preview created for package Built with commit: e1680836dc7391e62ac1f23e5702b9eeda5b78b8 |
Deploy preview created for package Built with commit: e1680836dc7391e62ac1f23e5702b9eeda5b78b8 |
Deploy preview created for package Built with commit: e1680836dc7391e62ac1f23e5702b9eeda5b78b8 |
Deploy preview created for package Built with commit: e1680836dc7391e62ac1f23e5702b9eeda5b78b8 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
creating a
card-copy
component that extendsDDSMarkdown
I think this would be fine given that the component was supposed to have this functionality already. Since the concern is around it being a breaking change it should be ok to make this update in v2
looks good to me, just needs a few CI test updates
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
one thing I noticed, characters like #
and &
won't render properly in the card copy with the markdown parser
related #7469
@emyarod I was able to get the |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
looks good to me! should we create a separate issue for the storybook rendering problems?
@IgnacioBecerra just double checking if the font size change in the link list was intentional here? or perhaps this is coming from an outdated baseline? |
@jeffchew yeah that change isn't coming from this PR, the actual font size isn't changing with these changes |
@IgnacioBecerra there seems to be something going on with the card group too, I don't see this on latest canary and double checked that it's happening on your fork: |
@jeffchew Found out what was happening -- once there is a In other words, any use of the utility after using As mentioned in an earlier comment, creating a |
@IgnacioBecerra thank you for updating, the diffs look much better! There's still a slight diff for this, wondering if we need a design eye to take a glance at this? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks @IgnacioBecerra !
Related Ticket(s)
#7481
Description
This PR ensures that the copy elements in Card and Content Section can render markdown properly. The approach used in Card queries the slotted
p
tag and applies the markdown utility function. While a simpler method may be creating acard-copy
component that extendsDDSMarkdown
, I refrained from doing so to avoid a breaking change for adopters using Card. Feel free to let me know what you think about doing that approach instead and simply mentioning it in the release notes.Note:
Testing markdown in Storybook seems to only work once (i.e. inputting
*test*
, deleting it, and trying the same thing will result in the text being wrapped in asterisks without formatting.However, if an adopter uses markdown in the copy of the Card component, it will render properly.
Changelog
Changed
DDSMarkdown
component