Closed leehuwuj closed 2 weeks ago
Latest commit: f4accb1029b17e62c7bdc3e13099628d52969bb0
The changes in this PR will be included in the next version bump.
Not sure what this means? Click here to learn what changesets are.
Click here if you're a maintainer who wants to add another changeset to this PR
These changes are focused on improving the handling of URLs in markdown content rendered by a chat application. The key update is the introduction of a preprocessMedia
function in markdown.tsx
to remove problematic URL prefixes like sandbox:
, ensuring correct display of media. This function is integrated into the existing preprocessContent
function.
Files | Change Summary |
---|---|
templates/.../chat-message/markdown.tsx |
Introduced preprocessMedia to clean URL prefixes, integrated into preprocessContent . |
.changeset/quick-socks-learn.md |
Documented issue and fix regarding sandbox: URL prefix in OpenAI model outputs. |
Updated changeset | Modified the summary to clarify the removal of prefixes like sandbox: from URLs in markdown.tsx . |
sequenceDiagram
participant User
participant ChatApp
participant MarkdownProcessor as Markdown Processor
User->>ChatApp: Sends markdown content
ChatApp->>MarkdownProcessor: Preprocess content
MarkdownProcessor->>MarkdownProcessor: Call preprocessContent
MarkdownProcessor-->>MarkdownProcessor: Call preprocessMedia to clean URLs
MarkdownProcessor-->>ChatApp: Return processed content
ChatApp-->>User: Render cleaned content
Amidst the code where URLs prance,
A bunny found the chance to dance.
It stripped the "sandbox:" with glee,
So media could be viewed carefree.🎨
Now every link is shining bright,
Thanks to our code friend, day and night.
🐇✨
Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media?
Summary by CodeRabbit
sandbox:
prefixes from URLs, ensuring better compatibility with OpenAI's models.