Skip to content

Commit df42550

Browse files
committed
Support markdown in image description
1 parent 9028efe commit df42550

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

web/src/components/PreviewImages.astro

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
---
22
import { Image } from "astro:assets";
33
import { getAssetImagePath } from "@src/utils/general";
4+
import { marked } from "marked";
45
56
interface Props {
67
images?: any[];
@@ -35,7 +36,7 @@ if (images?.length) {
3536

3637
<div class="preview-images">
3738
{images.map(({ src, description, resolvedPath, width, height }) => (
38-
<a href={src} class="glightbox" data-description={description} data-gallery="gallery">
39+
<a href={src} class="glightbox" data-description={marked(description)} data-gallery="gallery">
3940
<Image
4041
width={width}
4142
height={height}

0 commit comments

Comments
 (0)