From b217427dc9672d9563a4dde59c24a8630caacac2 Mon Sep 17 00:00:00 2001 From: Jimmy Cai Date: Sun, 6 Feb 2022 18:53:57 +0000 Subject: [PATCH] Remove data-alt-html --- assets/ts/gallery.ts | 4 ++-- layouts/_default/_markup/render-image.html | 2 -- 2 files changed, 2 insertions(+), 4 deletions(-) diff --git a/assets/ts/gallery.ts b/assets/ts/gallery.ts index 730139b..ec7c02d 100644 --- a/assets/ts/gallery.ts +++ b/assets/ts/gallery.ts @@ -77,7 +77,7 @@ class StackGallery { if (!isNewLineImage) continue; const hasLink = img.parentElement.tagName == 'A'; - + let el: HTMLElement = img; /// Wrap image with figure tag, with flex-grow and flex-basis values extracted from img's data attributes const figure = document.createElement('figure'); @@ -93,7 +93,7 @@ class StackGallery { /// Add figcaption if it exists if (img.hasAttribute('alt')) { const figcaption = document.createElement('figcaption'); - figcaption.innerHTML = img.getAttribute('data-alt-html'); + figcaption.innerText = img.getAttribute('alt'); figure.appendChild(figcaption); } diff --git a/layouts/_default/_markup/render-image.html b/layouts/_default/_markup/render-image.html index ceda1ed..0ed5584 100644 --- a/layouts/_default/_markup/render-image.html +++ b/layouts/_default/_markup/render-image.html @@ -32,9 +32,7 @@ loading="lazy" {{ with $alt }} alt="{{ . }}" - data-alt-html="{{ . | markdownify }}" {{ end }} - {{ if $galleryImage }} class="gallery-image" data-flex-grow="{{ div (mul $image.Width 100) $image.Height }}"