比较提交

..

没有共同的提交。dab0b94ec4c59974c513c4585585e4177538168c 和 61e84a98c7141661427c9a72367301da8a84779e 的历史完全不同。

共有 2 个文件被更改,包括 7 次插入19 次删除

查看文件

@ -175,22 +175,14 @@ std::string Parser::parse(const PageDao &pagedao, UrlProvider &provider, const s
std::string result;
// we don't care about commands, but we nevertheless replace them with empty strings
std::regex tagfinder(
R"(\[(b|i|u|s|li|p|br|ul|ol|code|blockquote|img|link|wikilink|h\d|cmd:visible|cmd:listed|cmd:feedlisted|cmd:rename|cmd:redirect|cmd:pagetitle|cmd:allowinclude|cmd:permissions|cmd:parentpage|content|category|dynamic:postlist|dynamic:includepage|dynamic:getvar|dynamic:setvar)*?\]((\s|\S)*?)\[/\1](\r\n)*)");
const std::string justreplace[] = {"b", "i", "u", "p", "br", "ul", "li", "ol"};
R"(\[(b|i|u|s|li||ul|ol|code|blockquote|img|link|wikilink|h\d|cmd:visible|cmd:listed|cmd:feedlisted|cmd:rename|cmd:redirect|cmd:pagetitle|cmd:allowinclude|cmd:permissions|cmd:parentpage|content|category|dynamic:postlist|dynamic:includepage|dynamic:getvar|dynamic:setvar)*?\]((\s|\S)*?)\[/\1])");
result = utils::regex_callback_replacer(
tagfinder, content,
[&](std::smatch &match)
{
std::string tag = match.str(1);
std::string content = match.str(2);
std::string newlines = match.str(4);
if(newlines == "\r\n")
{
newlines = "<br>";
}
std::string justreplace[] = {"b", "i", "u", "ul", "li", "ol", "s"};
if(tag != "code" && tag != "blockquote")
{
content = parse(pagedao, provider, content, callback);
@ -202,17 +194,13 @@ std::string Parser::parse(const PageDao &pagedao, UrlProvider &provider, const s
}
if(std::find(std::begin(justreplace), std::end(justreplace), tag) != std::end(justreplace))
{
if(tag == "p" || tag == "br")
{
newlines = "";
}
return "<" + tag + ">" + content + "</" + tag + ">" + newlines;
return "<" + tag + ">" + content + "</" + tag + ">";
}
if(tag == "link" || tag == "wikilink")
{
return this->processLink(pagedao, provider,
match) +
newlines; // TODO: recreate this so we don't check inside the function stuff again
return this->processLink(
pagedao, provider,
match); // TODO: recreate this so we don't check inside the function stuff again
}
if(tag == "img")
{

@ -1 +1 @@
Subproject commit 5c00bbf36ba8ff47b4fb97712fc38cb2884e5b98
Subproject commit c7ed1796a778592ae5a122287a16b1dd4770858a