From e4f634705b9f9a21d0c0f9413390faca1151f244 Mon Sep 17 00:00:00 2001 From: Mitarashi Date: Mon, 24 Jan 2022 21:53:59 +0200 Subject: [PATCH] Fix #521 --- src/parserutils.nim | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/parserutils.nim b/src/parserutils.nim index 0e7c8b5..d4a0aca 100644 --- a/src/parserutils.nim +++ b/src/parserutils.nim @@ -8,7 +8,7 @@ let unRegex = re"(^|[^A-z0-9-_./?])@([A-z0-9_]{1,15})" unReplace = "$1@$2" - htRegex = re"(^|[^\w-_./?])([##$])([\w_]+)" + htRegex = re"(^|[^\w-_./?])([#$]|#)([\w_]+)" htReplace = "$1$2$3" type @@ -210,7 +210,7 @@ proc expandUserEntities*(user: var User; js: JsonNode) = replacements.deduplicate replacements.sort(cmp) - + user.bio = orig.replacedWith(replacements, 0 .. orig.len) user.bio = user.bio.replacef(unRegex, unReplace) .replacef(htRegex, htReplace)