Temporarily switch to boost::regex

In combination with musl, parser crashed. glibc fine. Could not pinpoint
down the exact reason mainly due to time constraints. Strange, in both
cases actually libstdc++ is used, so this is very odd.
Šī revīzija ir iekļauta:
2018-11-11 21:28:45 +01:00
vecāks 28bf5ab6d4
revīzija 882871c34f
5 mainīti faili ar 18 papildinājumiem un 16 dzēšanām

Parādīt failu

@ -27,7 +27,6 @@ SOFTWARE.
#include "parser.h"
#include "utils.h"
#include "htmllink.h"
std::vector<Headline> Parser::extractHeadlines(std::string content) const
{
std::vector<Headline> result;
@ -82,7 +81,7 @@ std::string Parser::extractCommand(std::string cmdname, std::string content) con
}
return "";
}
std::string Parser::processLink(const PageDao &pageDao, UrlProvider &urlProvider, std::smatch &match) const
std::string Parser::processLink(const PageDao &pageDao, UrlProvider &urlProvider, boost::smatch &match) const
{
std::string linktag = match.str(1);
std::string inside = match.str(2);
@ -121,8 +120,8 @@ std::string Parser::parse(const PageDao &pagedao, UrlProvider &provider, std::st
{
std::string result;
// we don't care about commands, but we nevertheless replace them with empty strings
std::regex tagfinder(R"(\[(b|i|u|li||ul|ol|link|wikilink|h\d|cmd:rename|cmd:redirect)*?\]((\s|\S)*?)\[/\1])");
result = utils::regex_callback_replacer(tagfinder, content, [&](std::smatch &match) {
boost::regex tagfinder(R"(\[(b|i|u|li||ul|ol|link|wikilink|h\d|cmd:rename|cmd:redirect)*?\]((\s|\S)*?)\[/\1])");
result = utils::regex_callback_replacer(tagfinder, content, [&](boost::smatch &match) {
std::string tag = match.str(1);
std::string content = match.str(2);
std::string justreplace[] = {"b", "i", "u", "ul", "li", "ol"};