File tree 2 files changed +4
-4
lines changed
2 files changed +4
-4
lines changed Original file line number Diff line number Diff line change @@ -137,8 +137,8 @@ class Renderer extends MarkedRenderer {
137
137
if ( lazyload ) out += ' loading="lazy"' ;
138
138
139
139
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 >`;
142
142
}
143
143
return out ;
144
144
}
Original file line number Diff line number Diff line change @@ -806,8 +806,8 @@ describe('Marked renderer', () => {
806
806
807
807
result . should . eql ( [
808
808
'<p><img src="/bar/baz.jpg" title="bar">' ,
809
- '<img src="/bar/baz.jpg" alt="foo" title="bar"><figcaption aria-hidden="true">foo</figcaption>' ,
810
- '<img src="/aaa/bbb.jpg" alt="foo"><figcaption aria-hidden="true">foo</figcaption></p>\n'
809
+ '<figure>< img src="/bar/baz.jpg" alt="foo" title="bar"><figcaption aria-hidden="true">foo</figcaption></figure >' ,
810
+ '<figure>< img src="/aaa/bbb.jpg" alt="foo"><figcaption aria-hidden="true">foo</figcaption></figure ></p>\n'
811
811
] . join ( '\n' ) ) ;
812
812
} ) ;
813
813
You can’t perform that action at this time.
0 commit comments