From 2dc9fc1626507bb54417fc4a1920b847cafb27a2 Mon Sep 17 00:00:00 2001 From: tobi <31960611+tsmethurst@users.noreply.github.com> Date: Wed, 25 Aug 2021 15:34:33 +0200 Subject: Pg to bun (#148) * start moving to bun * changing more stuff * more * and yet more * tests passing * seems stable now * more big changes * small fix * little fixes --- internal/text/formatter.go | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) (limited to 'internal/text/formatter.go') diff --git a/internal/text/formatter.go b/internal/text/formatter.go index 39aaae559..769ecafbb 100644 --- a/internal/text/formatter.go +++ b/internal/text/formatter.go @@ -19,6 +19,8 @@ package text import ( + "context" + "github.com/sirupsen/logrus" "github.com/superseriousbusiness/gotosocial/internal/config" "github.com/superseriousbusiness/gotosocial/internal/db" @@ -28,16 +30,16 @@ import ( // Formatter wraps some logic and functions for parsing statuses and other text input into nice html. type Formatter interface { // FromMarkdown parses an HTML text from a markdown-formatted text. - FromMarkdown(md string, mentions []*gtsmodel.Mention, tags []*gtsmodel.Tag) string + FromMarkdown(ctx context.Context, md string, mentions []*gtsmodel.Mention, tags []*gtsmodel.Tag) string // FromPlain parses an HTML text from a plaintext. - FromPlain(plain string, mentions []*gtsmodel.Mention, tags []*gtsmodel.Tag) string + FromPlain(ctx context.Context, plain string, mentions []*gtsmodel.Mention, tags []*gtsmodel.Tag) string // ReplaceTags takes a piece of text and a slice of tags, and returns the same text with the tags nicely formatted as hrefs. - ReplaceTags(in string, tags []*gtsmodel.Tag) string + ReplaceTags(ctx context.Context, in string, tags []*gtsmodel.Tag) string // ReplaceMentions takes a piece of text and a slice of mentions, and returns the same text with the mentions nicely formatted as hrefs. - ReplaceMentions(in string, mentions []*gtsmodel.Mention) string + ReplaceMentions(ctx context.Context, in string, mentions []*gtsmodel.Mention) string // ReplaceLinks takes a piece of text, finds all recognizable links in that text, and replaces them with hrefs. - ReplaceLinks(in string) string + ReplaceLinks(ctx context.Context, in string) string } type formatter struct { -- cgit v1.2.3