summaryrefslogtreecommitdiff
path: root/internal/text/markdown.go
diff options
context:
space:
mode:
Diffstat (limited to 'internal/text/markdown.go')
-rw-r--r--internal/text/markdown.go8
1 files changed, 5 insertions, 3 deletions
diff --git a/internal/text/markdown.go b/internal/text/markdown.go
index 5a7603615..eeeae0edf 100644
--- a/internal/text/markdown.go
+++ b/internal/text/markdown.go
@@ -19,21 +19,23 @@
package text
import (
+ "context"
+
"github.com/russross/blackfriday/v2"
"github.com/superseriousbusiness/gotosocial/internal/gtsmodel"
)
-func (f *formatter) FromMarkdown(md string, mentions []*gtsmodel.Mention, tags []*gtsmodel.Tag) string {
+func (f *formatter) FromMarkdown(ctx context.Context, md string, mentions []*gtsmodel.Mention, tags []*gtsmodel.Tag) string {
content := preformat(md)
// do the markdown parsing *first*
contentBytes := blackfriday.Run([]byte(content))
// format tags nicely
- content = f.ReplaceTags(string(contentBytes), tags)
+ content = f.ReplaceTags(ctx, string(contentBytes), tags)
// format mentions nicely
- content = f.ReplaceMentions(content, mentions)
+ content = f.ReplaceMentions(ctx, content, mentions)
return postformat(content)
}