From 3a61c6c04060ac8187fe29b2efb02d1a45891a7e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Gr=C3=A9gory=20Oestreicher?= Date: Fri, 16 Dec 2016 15:01:28 +0100 Subject: [PATCH] Wrap articles in some HTML gravy on load --- qml/pages/ArticlePage.qml | 23 ++++++++++++++++++++++- 1 file changed, 22 insertions(+), 1 deletion(-) diff --git a/qml/pages/ArticlePage.qml b/qml/pages/ArticlePage.qml index a717f3e..4ac555e 100644 --- a/qml/pages/ArticlePage.qml +++ b/qml/pages/ArticlePage.qml @@ -26,6 +26,7 @@ Page { id: articlePage allowedOrientations: Orientation.All + property string title property string content SilicaWebView { @@ -33,7 +34,27 @@ Page { anchors.fill: parent Component.onCompleted: { - loadHtml( articlePage.content ) + loadHtml( wrapArticleContent() ) } } + + function wrapArticleContent() { + var html = + "" + + "" + + "" + + "" + + "" + + "
" + + "

" + articlePage.title + "

" + + articlePage.content + + "
" + + "" + + "" + + return html + } }