mirror of
https://github.com/superseriousbusiness/gotosocial.git
synced 2025-11-18 10:27:30 -06:00
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
This commit is contained in:
parent
071eca20ce
commit
2dc9fc1626
713 changed files with 98694 additions and 22704 deletions
|
|
@ -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 {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue