mirror of
https://github.com/zen-browser/docs.git
synced 2025-07-07 17:05:34 +02:00
Updated img component and added lint script
This commit is contained in:
parent
af0f6207d2
commit
d3d1b8e56b
2 changed files with 7 additions and 4 deletions
|
@ -6,7 +6,8 @@
|
||||||
"build": "next build",
|
"build": "next build",
|
||||||
"dev": "next dev",
|
"dev": "next dev",
|
||||||
"start": "next start",
|
"start": "next start",
|
||||||
"postinstall": "fumadocs-mdx"
|
"postinstall": "fumadocs-mdx",
|
||||||
|
"lint": "next lint"
|
||||||
},
|
},
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@theguild/remark-mermaid": "^0.3.0",
|
"@theguild/remark-mermaid": "^0.3.0",
|
||||||
|
|
|
@ -29,9 +29,11 @@ export default async function Page(props: {
|
||||||
components={{
|
components={{
|
||||||
...defaultMdxComponents,
|
...defaultMdxComponents,
|
||||||
a: createRelativeLink(source, page),
|
a: createRelativeLink(source, page),
|
||||||
img: (props: React.ImgHTMLAttributes<HTMLImageElement>) => (
|
img: (props: React.ImgHTMLAttributes<HTMLImageElement>) => {
|
||||||
<ImageZoom {...props} />
|
const { src, ...rest } = props;
|
||||||
),
|
if (typeof src !== "string") return null;
|
||||||
|
return <ImageZoom src={src} {...rest} />;
|
||||||
|
},
|
||||||
pre: (props) => (
|
pre: (props) => (
|
||||||
<CodeBlock {...props}>
|
<CodeBlock {...props}>
|
||||||
<Pre>{props.children}</Pre>
|
<Pre>{props.children}</Pre>
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue