Link parsing (#120)

* add link parsing + formatting functionality

* refinement + docs

* add missing test

* credit url library
This commit is contained in:
Tobi Smethurst
2021-07-28 11:42:26 +02:00
committed by GitHub
parent fddacdd1a8
commit ea8ad8b346
9 changed files with 434 additions and 51 deletions

View File

@@ -28,6 +28,9 @@ import (
func (f *formatter) FromPlain(plain string, mentions []*gtsmodel.Mention, tags []*gtsmodel.Tag) string {
content := preformat(plain)
// format links nicely
content = ReplaceLinks(content)
// format mentions nicely
for _, menchie := range mentions {
targetAccount := &gtsmodel.Account{}