Iframe Embeds in GitLab
Summary
Support embedding iframes in GitLab Flavored Markdown, enabling rich content embeds from services like YouTube, Figma, and others.
What Has Been Implemented
-
✅ Ability to configure permitting iframe embeds in Markdown on an instance level, with an allowlist approach for domains permitted inside such an iframe. -
✅ Embed viasyntax, whereurlis the iframe source.
What Could Still Be Implemented
-
Allow applying
width/heightparameters as these embeds by default are unhelpfully small — %18.10 -
Support transforming
<iframe>as written or copy-pasted in so we can take embed code from YouTube or Figma — %18.10 - Support default URL transformations for YouTube/Figma, so e.g. embedding a YouTube "view" URL also Just Works™ (DWIM principle) — %18.10
GA Considerations
There is no consideration for GA yet. After completing the above, the next step is to expand internal testing beyond Knowledge's repository. For GA, we'd need specific rewrites to make common URLs work as intended, e.g.:
-
https://www.youtube.com/watch?v=ABCD→https://www.youtube.com/embed/ABCD -
https://youtu.be/ABCD→https://www.youtube.com/embed/ABCD - Similar transformations for Figma
Otherwise the feature would fail in the most obvious of ways, as it's not clear to users that we expect the exact embed URL extracted from the <iframe> code these websites' embed tools provide.
Related Issues
- The original customer request for embedding GitLab pipeline artifacts in an iframe (via @jcarrano) is tracked separately in Support iframe embedding of GitLab pipeline art... (#590071).
Edited by Matthew Macfarlane