Add - und \u\u200b (zero width space) as word delimiters.
continuous-integration/drone/push Build is passing Details

This commit is contained in:
tastytea 2019-12-29 08:38:16 +01:00
parent a8c3127570
commit dec712b43e
Signed by: tastytea
GPG Key ID: CFC39497F1B26E07
1 changed files with 2 additions and 2 deletions

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:]]|^)("
+ tag + ")([[:space:][:punct:]]|$)", regex::icase);
regex re_tag("([[:space:][:punct:]-\u200b]|^)("
+ tag + ")([[:space:][:punct:]-\u200b]|$)", regex::icase);
out = regex_replace(out, re_tag, "$1#$2$3", boost::format_first_only);
}