From eb6db07c30d200ffc674063a72fa6a89326ea260 Mon Sep 17 00:00:00 2001 From: Azareal Date: Thu, 20 Sep 2018 16:47:54 +1000 Subject: [PATCH] Fixed a bug in the URL parser where it would demand a double newline rather than a single. --- common/parser.go | 3 +++ 1 file changed, 3 insertions(+) diff --git a/common/parser.go b/common/parser.go index 0f4395b8..f38fd85b 100644 --- a/common/parser.go +++ b/common/parser.go @@ -518,6 +518,7 @@ func ParseMessage(msg string, sectionID int, sectionType string /*, user User*/) hashLinkMap[hashType](&sb, msg, &i) lastItem = i } + i-- } else if msg[i] == '@' { sb.WriteString(msg[lastItem:i]) i++ @@ -540,6 +541,7 @@ func ParseMessage(msg string, sectionID int, sectionType string /*, user User*/) sb.WriteString("@" + menUser.Name) sb.Write(URLClose) lastItem = i + i-- } else if msg[i] == 'h' || msg[i] == 'f' || msg[i] == 'g' || msg[i] == '/' { if msg[i+1] == 't' && msg[i+2] == 't' && msg[i+3] == 'p' { if msg[i+4] == 's' && msg[i+5] == ':' && msg[i+6] == '/' { @@ -609,6 +611,7 @@ func ParseMessage(msg string, sectionID int, sectionType string /*, user User*/) sb.Write(URLClose) i += urlLen lastItem = i + i-- } } }