1
0
镜像自地址 https://github.com/quitesimpleorg/qsmaddy.git 已同步 2024-11-24 16:22:36 +01:00

emphasizedparser: Move from *this* to _this_

Signed-off-by: Patrick José Pereira <patrickelectric@gmail.com>
这个提交包含在:
Patrick José Pereira 2018-10-25 11:11:24 -03:00
父节点 e8ba8f661a
当前提交 ee42f7eae9

查看文件

@ -30,7 +30,7 @@ public:
/**
* Parse
*
* From Markdown: `text *text*`
* From Markdown: `text _text_`
*
* To HTML: `text <em>text</em>`
*
@ -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);