Doc: Make \youtube macro work with litehtml help backend

Unlike the QTextBrowser backend, litehtml does not render elements
inside <iframe> correctly. This prevented external links to
YouTube from working in offline documentation.

Move the <iframe> to a macro override specific to online doc builds.

Fixes: QTBUG-88975
Change-Id: Iff7828ddeed353620eaa9ac669a3e0c03749daa2
Reviewed-by: Paul Wicking <paul.wicking@qt.io>
(cherry picked from commit ca8e9ff2ef0a01248e3bdd718ef9fc06419214a4)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
This commit is contained in:
Topi Reinio 2020-11-27 16:31:54 +01:00 committed by Qt Cherry-pick Bot
parent 1e4c56463f
commit b16f9068c2
3 changed files with 8 additions and 3 deletions

View File

@ -0,0 +1,4 @@
macro.youtube.HTML = "<div class=\"video\">\n<span class=\"vspan\"></span>\n" \
"<iframe src=\"https://www.youtube.com/embed/\1\"" \
"frameborder=\"0\" allowfullscreen>\n" \
"</iframe></div>\n"

View File

@ -57,12 +57,10 @@ macro.QtMinorVersion.match = "\\d+\\.(\\d+)"
# qhp.ProjectName.extraFiles += images/dQw4w9WgXcQ.jpg
#
macro.youtube.HTML = "<div class=\"video\">\n<span class=\"vspan\"></span>\n" \
"<iframe src=\"https://www.youtube.com/embed/\1\"" \
"frameborder=\"0\" allowfullscreen>\n" \
"<a href=\"https://www.youtube.com/watch/?v=\1\">\n"\
"<img src=\"images/\1.jpg\"" \
"title=\"Click to play in a browser\" /></a>\n" \
"</iframe></div>\n"
"</div>\n"
macro.excludefromcreator = "\\meta tag broken"

View File

@ -23,6 +23,9 @@ include(manifest-meta.qdocconf)
include(fileextensions.qdocconf)
include(qt-html-templates-online.qdocconf)
#override macros for online use
include(macros-online.qdocconf)
#extra configuration data DITA information
include(config.qdocconf)