File tree Expand file tree Collapse file tree 4 files changed +18
-7
lines changed Expand file tree Collapse file tree 4 files changed +18
-7
lines changed Original file line number Diff line number Diff line change 65
65
font-weight : var (--spectrum-title-weight-s );
66
66
}
67
67
68
- & p : not (.author-description p , .quote__quotation ) {
68
+ & p : not (.author-description p , .quote__quotation , figcaption p ) {
69
69
margin-block-start : 0.5rem ;
70
70
}
71
71
}
Original file line number Diff line number Diff line change @@ -8,7 +8,7 @@ export default function decorate(block) {
8
8
const imageData = {
9
9
firstImage : block . children ?. [ 0 ] ?. children ?. [ 0 ] ?. firstElementChild ,
10
10
secondImage : block . children ?. [ 0 ] ?. children ?. [ 1 ] ?. firstElementChild ,
11
- caption : block . children ?. [ 1 ] ?. children ?. [ 0 ] ?. textContent ?. trim ( ) ,
11
+ caption : block . children ?. [ 1 ] ?. children ?. [ 0 ] ?. innerHTML ,
12
12
altText : block . children ?. [ 2 ] ?. children ?. [ 0 ] ?. textContent ?. trim ( ) ,
13
13
secondAltText : block . children ?. [ 2 ] ?. children ?. [ 1 ] ?. textContent ?. trim ( ) ,
14
14
fullWidth : block . children ?. [ 3 ] ?. children ?. [ 0 ] ?. textContent ?. trim ( ) ,
@@ -33,7 +33,7 @@ export default function decorate(block) {
33
33
if ( imageData . caption ) {
34
34
const imageCaption = document . createElement ( 'figcaption' ) ;
35
35
imageCaption . classList . add ( 'util-detail-s' , 'image-with-caption__caption' ) ;
36
- imageCaption . innerText = imageData . caption ;
36
+ imageCaption . innerHTML = imageData . caption ;
37
37
imageContainer . append ( imageCaption ) ;
38
38
}
39
39
Original file line number Diff line number Diff line change 22
22
23
23
.quote__quotation {
24
24
margin : 0 ;
25
+
26
+ & + .quote__quotation {
27
+ margin-top : 0.5em ;
28
+ }
25
29
}
26
30
27
31
.quote__attribution {
28
32
margin-block : 0.5rem 0 ;
29
33
34
+ & cite ,
30
35
& a {
31
36
font-style : normal;
32
37
}
Original file line number Diff line number Diff line change @@ -2,11 +2,17 @@ export default async function decorate(block) {
2
2
const [ quotation , attribution , attributionUrl ] = [ ...block . children ] . map ( ( c ) => c . firstElementChild ) ;
3
3
const blockquote = document . createElement ( 'blockquote' ) ;
4
4
5
- const quoteText = document . createElement ( 'p' ) ;
6
- quoteText . className = 'quote__quotation util-heading-quote' ;
7
- quoteText . innerHTML = quotation . innerText ;
8
- blockquote . append ( quoteText ) ;
5
+ // Append quote text, within paragraph(s). May contain links.
6
+ if ( quotation ?. children ?. length > 0 ) {
7
+ Array . from ( quotation . children ) . forEach ( textElement => {
8
+ const quoteText = document . createElement ( 'p' ) ;
9
+ quoteText . className = 'quote__quotation util-heading-quote' ;
10
+ quoteText . innerHTML = textElement . innerHTML ;
11
+ blockquote . append ( quoteText ) ;
12
+ } ) ;
13
+ }
9
14
15
+ // Append optional paragraph with attribution text and link.
10
16
if ( attribution ) {
11
17
const attributionText = document . createElement ( 'p' ) ;
12
18
attributionText . className = 'quote__attribution util-detail-s' ;
You can’t perform that action at this time.
0 commit comments