mirror of
https://github.com/superseriousbusiness/gotosocial
synced 2025-06-05 21:59:39 +02:00
[bugfix] html escape special characters in text instead of totally removing them (#719)
* remove minify dependency * tidy up some tests * remove pre + postformat funcs * rework sanitization + formatting * update tests * add some more markdown tests
This commit is contained in:
@ -26,13 +26,11 @@ import (
|
||||
)
|
||||
|
||||
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))
|
||||
contentBytes := blackfriday.Run([]byte(md))
|
||||
|
||||
// format tags nicely
|
||||
content = f.ReplaceTags(ctx, string(contentBytes), tags)
|
||||
content := f.ReplaceTags(ctx, string(contentBytes), tags)
|
||||
|
||||
// format mentions nicely
|
||||
content = f.ReplaceMentions(ctx, content, mentions)
|
||||
|
Reference in New Issue
Block a user