Skip to content

Commit

Permalink
feat: add sandboxed SVG/HTML support (#210)
Browse files Browse the repository at this point in the history
Co-authored-by: David Case <[email protected]>
  • Loading branch information
shruggr and David Case authored Apr 2, 2024
1 parent c730fd3 commit 06f23e9
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions src/components/Ordinal.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -91,6 +91,13 @@ export const Ordinal = (props: OrdinalProps) => {

const renderContent = () => {
switch (true) {
case contentType?.startsWith('image/svg'):
case contentType?.startsWith('text/html'):
return (
<OrdinalWrapper size={size} selected={selected} url={url} theme={theme} onClick={onClick}>
<iframe src={url} style={{ border: '0px', height: '100%', width: '100%' }} sandbox="true" />
</OrdinalWrapper>
);
case contentType?.startsWith('image/'):
return (
<OrdinalWrapper
Expand Down

0 comments on commit 06f23e9

Please sign in to comment.