summaryrefslogtreecommitdiff
path: root/internal/text/formatter.go
diff options
context:
space:
mode:
authorLibravatar tobi <31960611+tsmethurst@users.noreply.github.com>2021-08-25 15:34:33 +0200
committerLibravatar GitHub <noreply@github.com>2021-08-25 15:34:33 +0200
commit2dc9fc1626507bb54417fc4a1920b847cafb27a2 (patch)
tree4ddeac479b923db38090aac8bd9209f3646851c1 /internal/text/formatter.go
parentManually approves followers (#146) (diff)
downloadgotosocial-2dc9fc1626507bb54417fc4a1920b847cafb27a2.tar.xz
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
Diffstat (limited to 'internal/text/formatter.go')
-rw-r--r--internal/text/formatter.go12
1 files changed, 7 insertions, 5 deletions
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 {