Remove data-alt-html

This commit is contained in:
Jimmy Cai 2022-02-06 18:53:57 +00:00 committed by GitHub
parent cf515e73bb
commit b217427dc9
2 changed files with 2 additions and 4 deletions

View File

@ -77,7 +77,7 @@ class StackGallery {
if (!isNewLineImage) continue; if (!isNewLineImage) continue;
const hasLink = img.parentElement.tagName == 'A'; const hasLink = img.parentElement.tagName == 'A';
let el: HTMLElement = img; let el: HTMLElement = img;
/// Wrap image with figure tag, with flex-grow and flex-basis values extracted from img's data attributes /// Wrap image with figure tag, with flex-grow and flex-basis values extracted from img's data attributes
const figure = document.createElement('figure'); const figure = document.createElement('figure');
@ -93,7 +93,7 @@ class StackGallery {
/// Add figcaption if it exists /// Add figcaption if it exists
if (img.hasAttribute('alt')) { if (img.hasAttribute('alt')) {
const figcaption = document.createElement('figcaption'); const figcaption = document.createElement('figcaption');
figcaption.innerHTML = img.getAttribute('data-alt-html'); figcaption.innerText = img.getAttribute('alt');
figure.appendChild(figcaption); figure.appendChild(figcaption);
} }

View File

@ -32,9 +32,7 @@
loading="lazy" loading="lazy"
{{ with $alt }} {{ with $alt }}
alt="{{ . }}" alt="{{ . }}"
data-alt-html="{{ . | markdownify }}"
{{ end }} {{ end }}
{{ if $galleryImage }} {{ if $galleryImage }}
class="gallery-image" class="gallery-image"
data-flex-grow="{{ div (mul $image.Width 100) $image.Height }}" data-flex-grow="{{ div (mul $image.Width 100) $image.Height }}"