Skip to content

Commit

Permalink
chore(docs): Update images/videos for markdown pages
Browse files Browse the repository at this point in the history
  • Loading branch information
mlaursen committed Nov 29, 2021
1 parent 0df0f24 commit 5e482bb
Showing 1 changed file with 19 additions and 0 deletions.
19 changes: 19 additions & 0 deletions packages/documentation/src/components/Markdown/renderers.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import {
DEFAULT_MARKDOWN_RENDERERS,
getTokensText,
ImageRenderer,
MarkdownRenderers,
useSluggedId,
} from "react-marked-renderer";
Expand Down Expand Up @@ -117,6 +118,24 @@ export const renderers: MarkdownRenderers = {
);
},

img: function Img({ href, ...props }) {
return (
<Link
href={href}
className="rmd-media-container rmd-media-container--auto"
>
{href.endsWith(".mp4") ? (
<video autoPlay loop muted controls>
<source src={href} type="video/mp4" />
{props.text || props.title}
</video>
) : (
<ImageRenderer href={href} {...props} />
)}
</Link>
);
},

table: function TableRenderer({ children }) {
return (
<TableContainer>
Expand Down

1 comment on commit 5e482bb

@vercel
Copy link

@vercel vercel bot commented on 5e482bb Nov 29, 2021

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please sign in to comment.