File tree 4 files changed +6
-6
lines changed
packages/kg-default-cards
4 files changed +6
-6
lines changed Original file line number Diff line number Diff line change @@ -16,7 +16,7 @@ module.exports = {
16
16
17
17
if ( payload . caption ) {
18
18
let figcaption = dom . createElement ( 'figcaption' ) ;
19
- figcaption . appendChild ( dom . createTextNode ( payload . caption ) ) ;
19
+ figcaption . appendChild ( dom . createRawHTMLSection ( payload . caption ) ) ;
20
20
figure . appendChild ( figcaption ) ;
21
21
}
22
22
Original file line number Diff line number Diff line change @@ -28,7 +28,7 @@ module.exports = {
28
28
29
29
if ( payload . caption ) {
30
30
let figcaption = dom . createElement ( 'figcaption' ) ;
31
- figcaption . appendChild ( dom . createTextNode ( payload . caption ) ) ;
31
+ figcaption . appendChild ( dom . createRawHTMLSection ( payload . caption ) ) ;
32
32
figure . appendChild ( figcaption ) ;
33
33
}
34
34
Original file line number Diff line number Diff line change @@ -63,10 +63,10 @@ describe('Embed card', function () {
63
63
} ,
64
64
payload : {
65
65
html : 'Testing' ,
66
- caption : 'Caption'
66
+ caption : '<strong> Caption</strong> '
67
67
}
68
68
} ;
69
69
70
- serializer . serialize ( card . render ( opts ) ) . should . match ( '<figure class="kg-embed-card">Testing<figcaption>Caption</figcaption></figure>' ) ;
70
+ serializer . serialize ( card . render ( opts ) ) . should . match ( '<figure class="kg-embed-card">Testing<figcaption><strong> Caption</strong> </figcaption></figure>' ) ;
71
71
} ) ;
72
72
} ) ;
Original file line number Diff line number Diff line change @@ -24,11 +24,11 @@ describe('Image card', function () {
24
24
} ,
25
25
payload : {
26
26
src : 'https://www.ghost.org/image.png' ,
27
- caption : 'Test caption'
27
+ caption : '<b> Test caption</b> '
28
28
}
29
29
} ;
30
30
31
- serializer . serialize ( card . render ( opts ) ) . should . eql ( '<figure class="kg-image-card"><img src="https://www.ghost.org/image.png" class="kg-image"><figcaption>Test caption</figcaption></figure>' ) ;
31
+ serializer . serialize ( card . render ( opts ) ) . should . eql ( '<figure class="kg-image-card"><img src="https://www.ghost.org/image.png" class="kg-image"><figcaption><b> Test caption</b> </figcaption></figure>' ) ;
32
32
} ) ;
33
33
34
34
it ( 'renders an image with alt text' , function ( ) {
You can’t perform that action at this time.
0 commit comments