Skip to content
Snippets Groups Projects
Unverified Commit 64732f05 authored by Huu Le's avatar Huu Le Committed by GitHub
Browse files

Fix: remove sandbox link from openai models (#145)

parent 588e0d60
No related branches found
No related tags found
No related merge requests found
---
"create-llama": patch
---
Fix the issue of images not showing with the sandbox URL from OpenAI's models
......@@ -28,8 +28,19 @@ const preprocessLaTeX = (content: string) => {
return inlineProcessedContent;
};
const preprocessMedia = (content: string) => {
// Remove `sandbox:` from the beginning of the URL
// to fix OpenAI's models issue appending `sandbox:` to the relative URL
return content.replace(/(sandbox|attachment|snt):/g, "");
};
const preprocessContent = (content: string) => {
return preprocessMedia(preprocessLaTeX(content));
};
export default function Markdown({ content }: { content: string }) {
const processedContent = preprocessLaTeX(content);
const processedContent = preprocessContent(content);
return (
<MemoizedReactMarkdown
className="prose dark:prose-invert prose-p:leading-relaxed prose-pre:p-0 break-words custom-markdown"
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment