Skip to content

Commit 85e3387

Browse files
committed
2 parents 27888e2 + 1557c17 commit 85e3387

File tree

2 files changed

+28
-4
lines changed

2 files changed

+28
-4
lines changed

src/components/Markdown.tsx

Lines changed: 21 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -92,7 +92,13 @@ const markdownComponents: Record<string, React.FC> = {
9292
iframe: (props) => (
9393
<iframe {...props} className="w-full" title="Embedded Content" />
9494
),
95-
img: ({ alt, src, className, children: _, ...props }: HTMLProps<HTMLImageElement>) => (
95+
img: ({
96+
alt,
97+
src,
98+
className,
99+
children: _,
100+
...props
101+
}: HTMLProps<HTMLImageElement>) => (
96102
<img
97103
{...props}
98104
src={src ? getNetlifyImageUrl(src) : undefined}
@@ -182,7 +188,8 @@ export function CodeBlock({
182188
;(async () => {
183189
const themes = ['github-light', 'tokyo-night']
184190
const normalizedLang = LANG_ALIASES[lang] || lang
185-
const effectiveLang = normalizedLang === 'mermaid' ? 'plaintext' : normalizedLang
191+
const effectiveLang =
192+
normalizedLang === 'mermaid' ? 'plaintext' : normalizedLang
186193

187194
const highlighter = await getHighlighter(lang)
188195

@@ -296,7 +303,18 @@ async function getHighlighter(language: string) {
296303
if (!highlighterPromise) {
297304
highlighterPromise = createHighlighter({
298305
themes: ['github-light', 'tokyo-night'],
299-
langs: ['typescript', 'javascript', 'tsx', 'jsx', 'bash', 'json', 'html', 'css', 'markdown', 'plaintext'],
306+
langs: [
307+
'typescript',
308+
'javascript',
309+
'tsx',
310+
'jsx',
311+
'bash',
312+
'json',
313+
'html',
314+
'css',
315+
'markdown',
316+
'plaintext',
317+
],
300318
})
301319
}
302320

src/components/SimpleMarkdown.tsx

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,13 @@ const markdownComponents: Record<string, React.FC<any>> = {
3838
</pre>
3939
)
4040
},
41-
img: ({ alt, src, className, children: _, ...props }: HTMLProps<HTMLImageElement>) => (
41+
img: ({
42+
alt,
43+
src,
44+
className,
45+
children: _,
46+
...props
47+
}: HTMLProps<HTMLImageElement>) => (
4248
<img
4349
{...props}
4450
src={src ? getNetlifyImageUrl(src) : undefined}

0 commit comments

Comments
 (0)