diff --git a/resources/js/components/SMHTML.vue b/resources/js/components/SMHTML.vue index 2dd85d1..3ec36bc 100644 --- a/resources/js/components/SMHTML.vue +++ b/resources/js/components/SMHTML.vue @@ -6,6 +6,7 @@ import DOMPurify from "dompurify"; import { computed } from "vue"; import { ImportMetaExtras } from "../../../import-meta"; +import SMImageGallery from "./SMImageGallery.vue"; const props = defineProps({ html: { @@ -30,6 +31,16 @@ const computedContent = computed(() => { ); html = props.html.replace(regexHref, '((?:\s*
  • <\/li>)+)\s*<\/ul>/gi; + html = html.replace(regexGallery, (match, p1) => { + const imageSrcs = p1 + .match(/<\/li>/gi) + .map((m) => m.match(/<\/li>/i)[1]); + return ``; + }); + // Update local images to use at most the large size const regexImg = new RegExp( `]*?)src="${ @@ -49,6 +60,9 @@ const computedContent = computed(() => { return { template: `
    ${html}
    `, + components: { + SMImageGallery, + }, }; }); diff --git a/resources/js/components/SMImageGallery.vue b/resources/js/components/SMImageGallery.vue new file mode 100644 index 0000000..e087829 --- /dev/null +++ b/resources/js/components/SMImageGallery.vue @@ -0,0 +1,258 @@ + + + + +