mirror of
https://github.com/progsource/maddy.git
synced 2026-03-25 07:50:39 +01:00
feat: add class to block code
This commit is contained in:
@@ -74,7 +74,7 @@ public:
|
||||
static bool
|
||||
IsStartingLine(const std::string& line)
|
||||
{
|
||||
static std::regex re("^(?:`){3}$");
|
||||
static std::regex re("^(?:`){3}(.*)$");
|
||||
return std::regex_match(line, re);
|
||||
}
|
||||
|
||||
@@ -123,6 +123,13 @@ protected:
|
||||
return;
|
||||
}
|
||||
}
|
||||
else if (!this->isStarted && line.substr(0, 3) == "```")
|
||||
{
|
||||
line = "<pre class=\"" + line.substr(3) + "\"><code>\n";
|
||||
this->isStarted = true;
|
||||
this->isFinished = false;
|
||||
return;
|
||||
}
|
||||
|
||||
line += "\n";
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user