Skip to content

Commit 7b1e957

Browse files
fix: figcaption only works within figure
1 parent b6ac346 commit 7b1e957

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

lib/renderer.js

+2-2
Original file line numberDiff line numberDiff line change
@@ -137,8 +137,8 @@ class Renderer extends MarkedRenderer {
137137
if (lazyload) out += ' loading="lazy"';
138138

139139
out += '>';
140-
if (figcaption) {
141-
if (text) out += `<figcaption aria-hidden="true">${text}</figcaption>`;
140+
if (figcaption && text) {
141+
return `<figure>${out}<figcaption aria-hidden="true">${text}</figcaption></figure>`;
142142
}
143143
return out;
144144
}

0 commit comments

Comments
 (0)