1
0
duplikat dari https://github.com/quitesimpleorg/qsmaddy.git synced 2025-06-26 21:22:05 +02:00

fixed the inline code now also for not directly following letters

* em
* s
* strong

updated regex
This commit is contained in:
M. Petra Baranski
2017-12-26 05:24:01 +01:00
orang tua 6619f03879
melakukan 2ee6840008
6 mengubah file dengan 9 tambahan dan 9 penghapusan

Melihat File

@ -41,7 +41,7 @@ public:
void
Parse(std::string& line) override
{
static std::regex re("(?!`|<code>)\\*(?!`|</code>)([^\\*]*)\\*(?!`|</code>)");
static std::regex re("(?!.*`.*|.*<code>.*)\\*(?!.*`.*|.*<\\/code>.*)([^\\*]*)\\*(?!.*`.*|.*<\\/code>.*)");
static std::string replacement = "<em>$1</em>";
line = std::regex_replace(line, re, replacement);

Melihat File

@ -39,7 +39,7 @@ public:
void
Parse(std::string& line) override
{
static std::regex re("(?!`|<code>)\\~\\~(?!`|</code>)([^\\~]*)\\~\\~(?!`|</code>)");
static std::regex re("(?!.*`.*|.*<code>.*)\\~\\~(?!.*`.*|.*<\\/code>.*)([^\\~]*)\\~\\~(?!.*`.*|.*<\\/code>.*)");
static std::string replacement = "<s>$1</s>";
line = std::regex_replace(line, re, replacement);

Melihat File

@ -41,7 +41,7 @@ public:
void
Parse(std::string& line) override
{
static std::regex re("(?!`|<code>)\\*\\*(?!`|</code>)([^\\*\\*]*)\\*\\*(?!`|</code>)");
static std::regex re("(?!.*`.*|.*<code>.*)\\*\\*(?!.*`.*|.*<\\/code>.*)([^\\*\\*]*)\\*\\*(?!.*`.*|.*<\\/code>.*)");
static std::string replacement = "<strong>$1</strong>";
line = std::regex_replace(line, re, replacement);