File tree Expand file tree Collapse file tree
src/project/types/website/listing
tests/docs/smoke-all/listings/target-attribute Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -557,7 +557,7 @@ function hydrateListing(
557557 // If the items have come from metadata, we should just show
558558 // all the columns in the table. Otherwise, we should use the
559559 // document default columns
560- const undisplayable = [ "path" ] ;
560+ const undisplayable = [ "path" , "target" ] ;
561561 return itemFields . filter ( ( field ) => {
562562 return ! undisplayable . includes ( field ) ;
563563 } ) ;
Original file line number Diff line number Diff line change 1+ ---
2+ listing :
3+ type : default
4+ contents :
5+ - title : " Post with target"
6+ path : posts/post-with-target.qmd
7+ target : " _blank"
8+ - title : " Post without target"
9+ path : posts/post-without-target.qmd
10+ _quarto :
11+ tests :
12+ html :
13+ ensureHtmlElements :
14+ -
15+ - " a[href$='post-with-target.html'][target='_blank'][rel='noopener']"
16+ - " a[href$='post-without-target.html']:not([target]):not([rel])"
17+ ensureHtmlElementCount :
18+ selectors : ['.listing-target']
19+ counts : [0]
20+ ---
21+
22+ ## Default listing with metadata specification test
Original file line number Diff line number Diff line change 22listing :
33 type : default
44 contents : posts/*.qmd
5- fields :
6- - title
75_quarto :
86 tests :
97 html :
108 ensureHtmlElements :
119 -
12- - " a[href$='post-with-target.html'][target='_blank']"
13- - " a[href$='post-without-target.html']:not([target])"
10+ - " a[href$='post-with-target.html'][target='_blank'][rel='noopener'] "
11+ - " a[href$='post-without-target.html']:not([target]):not([rel]) "
1412---
1513
1614## Default listing with target attribute test
Original file line number Diff line number Diff line change 1+ ---
2+ listing :
3+ type : grid
4+ contents :
5+ - title : " Post with target"
6+ path : posts/post-with-target.qmd
7+ target : " _blank"
8+ - title : " Post without target"
9+ path : posts/post-without-target.qmd
10+ _quarto :
11+ tests :
12+ html :
13+ ensureHtmlElements :
14+ -
15+ - " a[href$='post-with-target.html'][target='_blank'][rel='noopener']"
16+ - " a[href$='post-without-target.html']:not([target]):not([rel])"
17+ ensureHtmlElementCount :
18+ selectors : ['.listing-target']
19+ counts : [0]
20+ ---
21+
22+ ## Grid listing with metadata specification test
Original file line number Diff line number Diff line change 22listing :
33 type : grid
44 contents : posts/*.qmd
5- fields :
6- - title
75_quarto :
86 tests :
97 html :
108 ensureHtmlElements :
119 -
12- - " a[href$='post-with-target.html'][target='_blank']"
13- - " a[href$='post-without-target.html']:not([target])"
10+ - " a[href$='post-with-target.html'][target='_blank'][rel='noopener'] "
11+ - " a[href$='post-without-target.html']:not([target]):not([rel]) "
1412---
1513
1614## Grid listing with target attribute test
Original file line number Diff line number Diff line change 1+ ---
2+ listing :
3+ type : table
4+ contents :
5+ - title : " Post with target"
6+ path : posts/post-with-target.qmd
7+ target : " _blank"
8+ - title : " Post without target"
9+ path : posts/post-without-target.qmd
10+ table-hover : true
11+ _quarto :
12+ tests :
13+ html :
14+ ensureHtmlElements :
15+ -
16+ - " a[href$='post-with-target.html'][target='_blank'][rel='noopener']"
17+ - " a[href$='post-without-target.html']:not([target]):not([rel])"
18+ - " tr[onclick*='window.open']"
19+ ensureHtmlElementCount :
20+ selectors : ['.listing-target']
21+ counts : [0]
22+ ---
23+
24+ ## Table listing with metadata specification test
Original file line number Diff line number Diff line change 22listing :
33 type : table
44 contents : posts/*.qmd
5- fields :
6- - title
75 table-hover : true
86_quarto :
97 tests :
108 html :
119 ensureHtmlElements :
1210 -
13- - " a[href$='post-with-target.html'][target='_blank']"
14- - " a[href$='post-without-target.html']:not([target])"
11+ - " a[href$='post-with-target.html'][target='_blank'][rel='noopener'] "
12+ - " a[href$='post-without-target.html']:not([target]):not([rel]) "
1513 - " tr[onclick*='window.open']"
1614---
1715
You can’t perform that action at this time.
0 commit comments