File tree Expand file tree Collapse file tree 2 files changed +4
-4
lines changed
Expand file tree Collapse file tree 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 {
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 }
Original file line number Diff line number Diff line change @@ -806,8 +806,8 @@ describe('Marked renderer', () => {
806806
807807 result . should . eql ( [
808808 '<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'
811811 ] . join ( '\n' ) ) ;
812812 } ) ;
813813
You can’t perform that action at this time.
0 commit comments