diff --git a/src/components/Markdown/Markdawn.tsx b/src/components/Markdown/Markdawn.tsx index 80a8c03..f6fcb7c 100644 --- a/src/components/Markdown/Markdawn.tsx +++ b/src/components/Markdown/Markdawn.tsx @@ -22,6 +22,22 @@ export default function Markdawn(props: ScenBreakProps): JSX.Element { options={{ slugify: slugify, overrides: { + h1: { + component: (props: { + id: string; + style: React.CSSProperties; + children: React.ReactNode; + }) => { + return ( +
+

+ {props.children} +

+ +
+ ); + }, + }, h2: { component: (props: { id: string; @@ -33,23 +49,7 @@ export default function Markdawn(props: ScenBreakProps): JSX.Element {

{props.children}

- - - { - navigator.clipboard.writeText( - process.env.NEXT_PUBLIC_URL_SELF + - window.location.pathname + - "#" + - props.id - ); - }} - > - link - - - + ); }, @@ -65,23 +65,55 @@ export default function Markdawn(props: ScenBreakProps): JSX.Element {

{props.children}

- - - { - navigator.clipboard.writeText( - process.env.NEXT_PUBLIC_URL_SELF + - window.location.pathname + - "#" + - props.id - ); - }} - > - link - - - + + + ); + }, + }, + h4: { + component: (props: { + id: string; + style: React.CSSProperties; + children: React.ReactNode; + }) => { + return ( +
+

+ {props.children} +

+ +
+ ); + }, + }, + h5: { + component: (props: { + id: string; + style: React.CSSProperties; + children: React.ReactNode; + }) => { + return ( +
+
+ {props.children} +
+ +
+ ); + }, + }, + h6: { + component: (props: { + id: string; + style: React.CSSProperties; + children: React.ReactNode; + }) => { + return ( +
+
+ {props.children} +
+
); }, @@ -178,6 +210,28 @@ export default function Markdawn(props: ScenBreakProps): JSX.Element { return <>; } +function HeaderToolTip(props: { id: string }) { + return ( + + + { + navigator.clipboard.writeText( + process.env.NEXT_PUBLIC_URL_SELF + + window.location.pathname + + "#" + + props.id + ); + }} + > + link + + + + ); +} + export function preprocessMarkDawn(text: string): string { let scenebreakIndex = 0; const visitedSlugs: string[] = [];