diff options
author | 2021-08-25 15:34:33 +0200 | |
---|---|---|
committer | 2021-08-25 15:34:33 +0200 | |
commit | 2dc9fc1626507bb54417fc4a1920b847cafb27a2 (patch) | |
tree | 4ddeac479b923db38090aac8bd9209f3646851c1 /internal/text/markdown.go | |
parent | Manually approves followers (#146) (diff) | |
download | gotosocial-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/markdown.go')
-rw-r--r-- | internal/text/markdown.go | 8 |
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) } |