diff --git a/maddy/codeblockparser.h b/maddy/codeblockparser.h index 05ccb8880..29241c8f3 100644 --- a/maddy/codeblockparser.h +++ b/maddy/codeblockparser.h @@ -108,29 +108,24 @@ class CodeBlockParser : public BlockParser parseBlock(std::string& line) override { QString style = QString("\"background: %1; margin-left:12px; color:%2;\""). - arg(Utility::getAppHexColor("lightBackground")). - arg(Utility::getAppHexColor("lightText")); - - if (line == "```") - { - if (!this->isStarted) - { - line = "
\n";
+                arg(Utility::getAppHexColor("lightBackground"), Utility::getAppHexColor("lightText"));
+
+        if (line == "```") {
+            if (!this->isStarted) {
+                line = "
\n";
                 this->isStarted = true;
                 this->isFinished = false;
                 return;
-            }
-            else
-            {
-                line = "
"; + } else { + line = "
"; this->isFinished = true; this->isStarted = false; return; } - } - else if (!this->isStarted && line.substr(0, 3) == "```") - { - line = "
\n";
+        } else if (!this->isStarted && line.substr(0, 3) == "```") {
+            line = "
\n";
             this->isStarted = true;
             this->isFinished = false;
             return;