From a7dcfbe75a607b42d3838b8e36bbd452f5a7127b Mon Sep 17 00:00:00 2001 From: Laura Hausmann Date: Thu, 13 Jun 2024 22:06:20 +0200 Subject: [PATCH] [parsing] Allow termination of mention nodes with any character except : --- Iceshrimp.Parsing/Mfm.fs | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/Iceshrimp.Parsing/Mfm.fs b/Iceshrimp.Parsing/Mfm.fs index 46a01a5b..2e47ba11 100644 --- a/Iceshrimp.Parsing/Mfm.fs +++ b/Iceshrimp.Parsing/Mfm.fs @@ -168,11 +168,11 @@ module private MfmParser = // Patterns let italicPattern = (notFollowedBy <| str "**") >>. skipChar '*' let codePattern = (notFollowedBy <| str "```") >>. skipChar '`' - + // Matchers let hashtagMatcher = letter <|> digit <|> anyOf "-_" let hashtagSatisfier = attempt hashtagMatcher - + // Node parsers let italicNode = @@ -239,9 +239,8 @@ module private MfmParser = .>>. opt (skipChar '@' >>. domain) .>> (lookAhead <| choice - [ spaces1 - eof - skipAnyOf "()[].,;?*~\'" + [ eof + skipNoneOf ":" skipChar ':' .>> nextCharSatisfiesNot isAsciiLetterOrNumber ]) |>> fun (user: string, host: string option) -> MfmMentionNode(acct (user, host), user, host) :> MfmNode