Skip to content

Commit 245560d

Browse files
authored
Merge pull request #12811 from mcanouil/feat/support-youtube-short
feat: Add support for YouTube Shorts in video shortcode
2 parents dd24d1f + 4259d85 commit 245560d

File tree

3 files changed

+11
-0
lines changed

3 files changed

+11
-0
lines changed

news/changelog-1.8.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -54,6 +54,7 @@ All changes included in 1.8:
5454

5555
- ([#12727](https://github.com/quarto-dev/quarto-cli/issues/12727)): Do not crash in the presence of malformed tabset contents.
5656
- ([#12806](https://github.com/quarto-dev/quarto-cli/pull/12806)): Use pandoc APIs to handle codepage conversion on Windows.
57+
- ([#12811](https://github.com/quarto-dev/quarto-cli/pull/12811)): Add support for YouTube Shorts in `video` shortcode.
5758

5859
## Commands
5960

src/resources/extensions/quarto/video/video.lua

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -78,6 +78,7 @@ local youTubeBuilder = function(params)
7878
if not (params and params.src) then return nil end
7979
local src = params.src
8080
match = checkMatchStart(src, 'https://www.youtube.com/embed/')
81+
match = match or checkMatchStart(src, 'https://www.youtube.com/shorts/')
8182
match = match or checkMatchStart(src, 'https://www.youtube%-nocookie.com/embed/')
8283
match = match or checkMatchStart(src, 'https://youtu.be/')
8384
match = match or string.match(src, '%?v=(.-)&')

tests/docs/smoke-all/video/video-smoke-test.qmd

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,9 @@ _quarto:
3535

3636
- '#brightcove-test iframe[src$="https://players.brightcove.net/1460825906/default_default/index.html?videoId=5988531335001"]'
3737

38+
- "#youtube-short-test .quarto-video.ratio.ratio-16x9"
39+
- '#youtube-short-test iframe[src$="https://www.youtube.com/embed/Kra3uHSIuBY"]'
40+
3841
---
3942

4043
::: {#video-js-test}
@@ -106,3 +109,9 @@ _quarto:
106109
{{< video https://players.brightcove.net/1460825906/default_default/index.html?videoId=5988531335001 >}}
107110

108111
:::
112+
113+
::: {#youtube-short-test}
114+
115+
{{< video https://www.youtube.com/shorts/Kra3uHSIuBY >}}
116+
117+
:::

0 commit comments

Comments
 (0)