summaryrefslogtreecommitdiffstats
path: root/hugolib
diff options
context:
space:
mode:
authorAndrew Zenk <andrew@andrewzenk.com>2020-12-02 05:53:53 -0600
committerGitHub <noreply@github.com>2020-12-02 12:53:53 +0100
commit4fc918e02cfc7f260d6312248ff9d33e95b27943 (patch)
tree64621d7e7e447b644c8456503e0648e6e8ed9a0e /hugolib
parent0ad378b09cea90a2a70d7ff06af668abe22475a1 (diff)
tpl: Add title parameter to YouTube shortcode
Diffstat (limited to 'hugolib')
-rw-r--r--hugolib/embedded_shortcodes_test.go5
1 files changed, 5 insertions, 0 deletions
diff --git a/hugolib/embedded_shortcodes_test.go b/hugolib/embedded_shortcodes_test.go
index a998b85b7..b8acb2d80 100644
--- a/hugolib/embedded_shortcodes_test.go
+++ b/hugolib/embedded_shortcodes_test.go
@@ -184,6 +184,11 @@ func TestShortcodeYoutube(t *testing.T) {
`{{< youtube id="w7Ft2ymGmfc" class="video" autoplay="true" >}}`,
"(?s)\n<div class=\"video\">.*?<iframe src=\"https://www.youtube.com/embed/w7Ft2ymGmfc\\?autoplay=1\".*?allowfullscreen title=\"YouTube Video\">.*?</iframe>.*?</div>",
},
+ // set custom title for accessability)
+ {
+ `{{< youtube id="w7Ft2ymGmfc" title="A New Hugo Site in Under Two Minutes" >}}`,
+ "(?s)\n<div style=\".*?\">.*?<iframe src=\"https://www.youtube.com/embed/w7Ft2ymGmfc\" style=\".*?\" allowfullscreen title=\"A New Hugo Site in Under Two Minutes\">.*?</iframe>.*?</div>",
+ },
} {
var (
cfg, fs = newTestCfg()