Skip to content

Commit

Permalink
fix: figcaption only works within figure
Browse files Browse the repository at this point in the history
  • Loading branch information
stevenjoezhang committed Apr 1, 2024
1 parent b6ac346 commit 7b1e957
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions lib/renderer.js
Expand Up @@ -137,8 +137,8 @@ class Renderer extends MarkedRenderer {
if (lazyload) out += ' loading="lazy"';

out += '>';
if (figcaption) {
if (text) out += `<figcaption aria-hidden="true">${text}</figcaption>`;
if (figcaption && text) {
return `<figure>${out}<figcaption aria-hidden="true">${text}</figcaption></figure>`;
}
return out;
}
Expand Down

0 comments on commit 7b1e957

Please sign in to comment.