-
Notifications
You must be signed in to change notification settings - Fork 383
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
frontend: adds preview to html code snippets #160
Conversation
Cohere Hackathon 2024 Co-authored-by: Tomeu Cabot <[email protected]>
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## main #160 +/- ##
=======================================
Coverage ? 86.76%
=======================================
Files ? 128
Lines ? 4140
Branches ? 0
=======================================
Hits ? 3592
Misses ? 548
Partials ? 0 ☔ View full report in Codecov by Sentry. |
@misspia-cohere @wujessica would either of you have bandwidth to review 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.
neat!!
Closing in favor of #187 |
Description
Adds preview to
Pre
component to render HTML blocks using iframesAI Description
This pull request introduces a new feature that allows users to preview code blocks within an iframe.
Changes include:
addOnErrorToImg
,getReconstructedHtml
, andreplaceCodeBlockWithIframe
inpreview.ts
.Iframe
inIframe.tsx
.MessageContent.tsx
:isFulfilledMessage
andreplaceCodeBlockWithIframe
.md
based onisFulfilledMessage
and replace code block with an iframe.Markdown.tsx
:rehypeRaw
andIframe
.rehypeRaw
torehypePlugins
.iframe: Iframe
prop.package.json
andpackage-lock.json
:rehype-raw
dependency.