dkforest

A forum and chat platform (onion)
git clone https://git.dasho.dev/n0tr1v/dkforest.git
Log | Files | Refs | LICENSE

commit 780da8e7b476a5a727c5b79b12f0edb689e86728
parent 0d8262af36f802993d517c9fca89755c645fa9be
Author: n0tr1v <n0tr1v@protonmail.com>
Date:   Thu, 19 Jan 2023 00:08:04 -0800

fix quote bug since we now replace special double quote

Diffstat:
Mpkg/web/handlers/api/v1/topBarHandler.go | 4++--
1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/pkg/web/handlers/api/v1/topBarHandler.go b/pkg/web/handlers/api/v1/topBarHandler.go @@ -715,7 +715,7 @@ func convertQuote(origHtml string, roomKey string, roomID database.RoomID) (html const quotePrefix = `“[` const quoteSuffix = `”` html = origHtml - idx := strings.LastIndex(origHtml, quoteSuffix) + idx := strings.Index(origHtml, quoteSuffix) if strings.HasPrefix(origHtml, quotePrefix) && idx > -1 { prefixLen := len(quotePrefix) suffixLen := len(quoteSuffix) @@ -735,7 +735,7 @@ func styleQuote(origHtml string, quoted *database.ChatMessage) (html string) { const quoteSuffix = `”` html = origHtml if quoted != nil { - idx := strings.LastIndex(origHtml, quoteSuffix) + idx := strings.Index(origHtml, quoteSuffix) prefixLen := len(`<p>“[`) suffixLen := len(quoteSuffix) dateLen := 8 // 01:23:45 --> 8