Refine hashtag-regex.
All checks were successful
continuous-integration/drone/push Build is passing

This commit is contained in:
tastytea 2019-12-29 08:56:27 +01:00
parent 7e0278b542
commit dcc07fab75
Signed by: tastytea
GPG Key ID: CFC39497F1B26E07

View File

@ -244,8 +244,8 @@ string Document::add_hashtags(const string &text)
string out{text};
for (const auto &tag : _watchwords)
{
regex re_tag("([[:space:][:punct:]-\u200b]|^)("
+ tag + ")([[:space:][:punct:]-\u200b]|$)", regex::icase);
regex re_tag("([[:space:]\u200b]|^)("
+ tag + ")([[:space:]\u200b[:punct:]]|$)", regex::icase);
out = regex_replace(out, re_tag, "$1#$2$3", boost::format_first_only);
}