aboutsummaryrefslogtreecommitdiff
path: root/src/browsertab.cpp
diff options
context:
space:
mode:
authorFelix (xq) Queißner <git@mq32.de>2020-06-23 00:35:41 +0200
committerFelix (xq) Queißner <git@mq32.de>2020-06-23 00:35:41 +0200
commit0860a8ec32fd01b6fdea92e1e6a80de096e2e694 (patch)
treeb858ca1d88bad6050f51d9a413b48f74b1a21545 /src/browsertab.cpp
parent75ec461eeaa851cb5c53f4cfffc434e3e529ed1d (diff)
downloadkristall-0860a8ec32fd01b6fdea92e1e6a80de096e2e694.tar.gz
Starts to implement new markdown rendering
Diffstat (limited to 'src/browsertab.cpp')
-rw-r--r--src/browsertab.cpp13
1 files changed, 6 insertions, 7 deletions
diff --git a/src/browsertab.cpp b/src/browsertab.cpp
index f73ac4b..ae7fd20 100644
--- a/src/browsertab.cpp
+++ b/src/browsertab.cpp
@@ -5,6 +5,7 @@
#include "renderers/gophermaprenderer.hpp"
#include "renderers/geminirenderer.hpp"
#include "renderers/plaintextrenderer.hpp"
+#include "renderers/markdownrenderer.hpp"
#include "mimeparser.hpp"
@@ -416,16 +417,14 @@ void BrowserTab::on_requestComplete(const QByteArray &ref_data, const QString &m
document->setDocumentMargin(doc_style.margin);
document->setHtml(QString::fromUtf8(data));
}
-#if defined(QT_FEATURE_textmarkdownreader)
else if (not plaintext_only and mime.is("text","markdown"))
{
- document = std::make_unique<QTextDocument>();
- document->setDefaultFont(doc_style.standard_font);
- document->setDefaultStyleSheet(doc_style.toStyleSheet());
- document->setDocumentMargin(doc_style.margin);
- document->setMarkdown(QString::fromUtf8(data));
+ document = MarkdownRenderer::render(
+ data,
+ this->current_location,
+ doc_style,
+ this->outline);
}
-#endif
else if (mime.is("text"))
{
document = PlainTextRenderer::render(data, doc_style);