aboutsummaryrefslogtreecommitdiff
path: root/src/plugins
diff options
context:
space:
mode:
authordec05eba <dec05eba@protonmail.com>2022-11-23 20:41:40 +0100
committerdec05eba <dec05eba@protonmail.com>2022-11-23 22:25:02 +0100
commit0c4fd4700d6ee31f6b848d49a6aa7ebfa4a806fa (patch)
tree351e800914a053ab196d972a36e09911227e9f50 /src/plugins
parent1de2ff02bb746607727900180b6f32ded0cd7856 (diff)
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.
Diffstat (limited to 'src/plugins')
-rw-r--r--src/plugins/Fourchan.cpp5
1 files changed, 5 insertions, 0 deletions
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;
}