mirror of
https://github.com/gohugoio/hugo.git
synced 2025-08-20 21:31:32 +02:00
Add an iFrame title to the YouTube shortcode
To accommodate modern web accessibility as outlined here https://dequeuniversity.com/tips/provide-iframe-titles
This commit is contained in:
committed by
Bjørn Erik Pedersen
parent
07f6e1499c
commit
919bc9210a
@@ -202,17 +202,17 @@ func TestShortcodeYoutube(t *testing.T) {
|
||||
}{
|
||||
{
|
||||
`{{< youtube w7Ft2ymGmfc >}}`,
|
||||
"(?s)\n<div style=\".*?\">.*?<iframe src=\"//www.youtube.com/embed/w7Ft2ymGmfc\" style=\".*?\" allowfullscreen frameborder=\"0\">.*?</iframe>.*?</div>\n",
|
||||
"(?s)\n<div style=\".*?\">.*?<iframe src=\"//www.youtube.com/embed/w7Ft2ymGmfc\" style=\".*?\" allowfullscreen frameborder=\"0\" title=\"YouTube Video\">.*?</iframe>.*?</div>\n",
|
||||
},
|
||||
// set class
|
||||
{
|
||||
`{{< youtube w7Ft2ymGmfc video>}}`,
|
||||
"(?s)\n<div class=\"video\">.*?<iframe src=\"//www.youtube.com/embed/w7Ft2ymGmfc\" allowfullscreen frameborder=\"0\">.*?</iframe>.*?</div>\n",
|
||||
"(?s)\n<div class=\"video\">.*?<iframe src=\"//www.youtube.com/embed/w7Ft2ymGmfc\" allowfullscreen frameborder=\"0\" title=\"YouTube Video\">.*?</iframe>.*?</div>\n",
|
||||
},
|
||||
// set class and autoplay (using named params)
|
||||
{
|
||||
`{{< youtube id="w7Ft2ymGmfc" class="video" autoplay="true" >}}`,
|
||||
"(?s)\n<div class=\"video\">.*?<iframe src=\"//www.youtube.com/embed/w7Ft2ymGmfc\\?autoplay=1\".*?allowfullscreen frameborder=\"0\">.*?</iframe>.*?</div>",
|
||||
"(?s)\n<div class=\"video\">.*?<iframe src=\"//www.youtube.com/embed/w7Ft2ymGmfc\\?autoplay=1\".*?allowfullscreen frameborder=\"0\" title=\"YouTube Video\">.*?</iframe>.*?</div>",
|
||||
},
|
||||
} {
|
||||
var (
|
||||
|
Reference in New Issue
Block a user