Skip to content

Commit

Permalink
πŸ› Fix widgets so they don't render as text (#110)
Browse files Browse the repository at this point in the history
See #109

Co-authored-by: Angus Hollands <goosey15@gmail.com>
  • Loading branch information
rowanc1 and agoose77 authored Mar 16, 2023
1 parent e36163f commit 08b8881
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions src/inlineExpression.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -171,8 +171,11 @@ export function InlineRenderer({ value }: { value?: string }): JSX.Element {
}

// Explicitly render text/plain
const preferredMimeType = rendermime.preferredMimeType(mimeBundle ?? {});
if (preferredMimeType === 'text/plain') {
const preferred = rendermime.preferredMimeType(
mimeBundle ?? {},
trusted ? 'any' : 'ensure'
);
if (preferred === 'text/plain') {
return <PlainTextRenderer content={mimeBundle?.['text/plain'] as string} />;
}
// Explicitly render errors
Expand Down

0 comments on commit 08b8881

Please sign in to comment.