From 0c4fd4700d6ee31f6b848d49a6aa7ebfa4a806fa Mon Sep 17 00:00:00 2001 From: dec05eba Date: Wed, 23 Nov 2022 20:41:40 +0100 Subject: Re-add item drawing height diff shifting to fix bumping in item drawing Add newline before codeblock in 4chan if previous line is not a newline. --- src/plugins/Fourchan.cpp | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'src/plugins') diff --git a/src/plugins/Fourchan.cpp b/src/plugins/Fourchan.cpp index 1ce97c4..aa941d5 100644 --- a/src/plugins/Fourchan.cpp +++ b/src/plugins/Fourchan.cpp @@ -52,6 +52,9 @@ namespace QuickMedia { return false; index = thread_id_end + 2; + if(index >= url.size()) + return true; + post_id = url.substr(index); return true; } @@ -328,6 +331,8 @@ namespace QuickMedia { break; case CommentPiece::Type::CODEBLOCK: // TODO: Use a different colored background + if(!comment_text.empty() && comment_text.back() != '\n') + comment_text += '\n'; comment_text += Text::formatted_text(std::move(cp.text), mgl::Color(255, 255, 255, 255), FORMATTED_TEXT_FLAG_CODE); break; } -- cgit v1.2.3