mirror of
https://gitee.com/vnotex/vnote.git
synced 2025-07-05 13:59:52 +08:00

Thanks to [marked JavaScript library](https://github.com/chjj/marked) by Christopher Jeffrey. The [style sheet](http://kevinburke.bitbucket.org/markdowncss/markdown.css) was created by Kevin Burke. Signed-off-by: Le Tan <tamlokveer@gmail.com>
20 lines
492 B
C++
20 lines
492 B
C++
#include "vpreviewpage.h"
|
|
|
|
#include <QDesktopServices>
|
|
|
|
VPreviewPage::VPreviewPage(QWidget *parent) : QWebEnginePage(parent)
|
|
{
|
|
|
|
}
|
|
|
|
bool VPreviewPage::acceptNavigationRequest(const QUrl &url,
|
|
QWebEnginePage::NavigationType /*type*/,
|
|
bool /*isMainFrame*/)
|
|
{
|
|
// Only allow qrc:/index.html.
|
|
if (url.scheme() == QString("qrc"))
|
|
return true;
|
|
QDesktopServices::openUrl(url);
|
|
return false;
|
|
}
|