From 64e271dce2e5aca07abdca8e335b3f7cb9ba1114 Mon Sep 17 00:00:00 2001 From: "Felix (xq) Queißner" Date: Sun, 7 Mar 2021 11:58:37 +0100 Subject: Starts to implement new HTML renderer based on gumbo. Everything is a bit borked and only trivial documents work correctly. --- src/renderers/geminirenderer.cpp | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) (limited to 'src/renderers/geminirenderer.cpp') diff --git a/src/renderers/geminirenderer.cpp b/src/renderers/geminirenderer.cpp index 6bcd3a4..3a49706 100644 --- a/src/renderers/geminirenderer.cpp +++ b/src/renderers/geminirenderer.cpp @@ -36,7 +36,7 @@ std::unique_ptr GeminiRenderer::render( QUrl const &root_url, DocumentStyle const & themed_style, DocumentOutlineModel &outline, - QString* const page_title) + QString & page_title) { TextStyleInstance text_style { themed_style }; @@ -72,8 +72,7 @@ std::unique_ptr GeminiRenderer::render( // Set the last line of the preformatted block to have // standard line height. QTextBlockFormat fmt = text_style.preformatted_format; - fmt.setLineHeight(themed_style.line_height_p, - QTextBlockFormat::LineDistanceHeight); + fmt.setLineHeight(themed_style.line_height_p, QTextBlockFormat::LineDistanceHeight); cursor.movePosition(QTextCursor::PreviousBlock); cursor.setBlockFormat(fmt); @@ -190,9 +189,9 @@ std::unique_ptr GeminiRenderer::render( outline.appendH1(heading, id); // Use first heading as the page's title. - if (page_title != nullptr && page_title->isEmpty()) + if (page_title.isEmpty()) { - *page_title = heading; + page_title = heading; } // Centre the first heading. We can't use the above code block -- cgit v1.2.3