-
Notifications
You must be signed in to change notification settings - Fork 1.3k
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
Use Nextra MDX parser in Component #3077
Comments
rename <MessageCard>
# Hello
- one
- two
> blockquote
</MessageCard> |
Thx @dimaMachina unfortunatly this didn't work. Maybe for more context. MessageCard is never used in a .mdx file only in .tsx file. The "content" is the response from a ChatGPT call. This is what I tried: type Message = {
role: Role;
content: string;
};
const MessageContent = ({ children }) => {
return (
<>
{children}
</>
)
}
const MessageCard = ({ role, content }: Message) => {
return (
<div
className={`flex flex-row ${
role === "assistant" ? "justify-start" : "justify-end"
}`}
>
<div
className={`p-4 max-w-[80%] rounded-lg ${
role === "assistant"
? "bg-zinc-800 text-zinc-50"
: "bg-zinc-50 text-zinc-800"
}`}
>
<MessageContent>{content}</MessageContent>
</div>
</div>
);
} Rather then using https://github.com/remarkjs/react-markdown I just want to use the already existing markdown compiler/parser. |
I think this can be fixed with new playground component #3174 |
I have the following component where the content is a string. The string contain markdown text. How can I use the nextra parser to render this string as markdown?
Similarly to the Callout component.
The component in question:
The text was updated successfully, but these errors were encountered: