use proper URL when extracting article

This commit is contained in:
Martin Rotter 2024-04-23 08:22:43 +02:00
parent c7c069d889
commit 43173c6b16
5 changed files with 22 additions and 5 deletions

View File

@ -48,6 +48,7 @@ body {
-webkit-font-feature-settings: "kern" 1;
font-feature-settings: "kern" 1;
font-kerning: normal;
padding: 10px !important;
min-height: 100vh;
}
@ -354,7 +355,7 @@ summary {
// m* == message*
.rssguard-mwrapper {
padding: $base-unit !important;
padding: 0px !important;
.rssguard-mhead {

View File

@ -17,6 +17,7 @@ body {
-webkit-font-feature-settings: "kern" 1;
font-feature-settings: "kern" 1;
font-kerning: normal;
padding: 10px !important;
min-height: 100vh; }
::selection {
@ -238,7 +239,7 @@ summary:focus {
outline: 1px solid #647595; }
.rssguard-mwrapper {
padding: 10px !important; }
padding: 0px !important; }
.rssguard-mwrapper .rssguard-mhead .msmall,
.rssguard-mwrapper .rssguard-mhead .mlinks {
opacity: .8; }

View File

@ -17,6 +17,7 @@ body {
-webkit-font-feature-settings: "kern" 1;
font-feature-settings: "kern" 1;
font-kerning: normal;
padding: 10px !important;
min-height: 100vh; }
::selection {
@ -238,7 +239,7 @@ summary:focus {
outline: 1px solid #5D88D2; }
.rssguard-mwrapper {
padding: 10px !important; }
padding: 0px !important; }
.rssguard-mwrapper .rssguard-mhead .msmall,
.rssguard-mwrapper .rssguard-mhead .mlinks {
opacity: .8; }

View File

@ -40,7 +40,7 @@ WebBrowser::WebBrowser(WebViewer* viewer, QWidget* parent)
m_actionReadabilePage(new QAction(qApp->icons()->fromTheme(QSL("text-html")),
tr("View website in reader mode"),
this)),
m_actionGetFullArticle(new QAction(qApp->icons()->fromTheme(QSL("download"), QSL("browser-download")),
m_actionGetFullArticle(new QAction(qApp->icons()->fromTheme(QSL("applications-office")),
tr("Load full source article"),
this)) {
if (m_webView == nullptr) {
@ -192,8 +192,20 @@ void WebBrowser::readabilePage() {
}
void WebBrowser::getFullArticle() {
QString url;
if (!m_messages.isEmpty() && !m_messages.first().m_url.isEmpty()) {
url = m_messages.first().m_url;
}
else if (m_webView->url().isValid()) {
url = m_webView->url().toString();
}
else {
return;
}
m_actionGetFullArticle->setEnabled(false);
qApp->web()->articleParse()->parseArticle(this, m_webView->url().toString());
qApp->web()->articleParse()->parseArticle(this, url);
}
bool WebBrowser::eventFilter(QObject* watched, QEvent* event) {

View File

@ -145,6 +145,8 @@ void WebEngineViewer::setUrl(const QUrl& url) {
void WebEngineViewer::setHtml(const QString& html, const QUrl& base_url) {
QWebEngineView::setHtml(html, base_url);
// IOFactory::writeFile("a.html", html.toUtf8());
}
void WebEngineViewer::setReadabledHtml(const QString& html, const QUrl& base_url) {