1
0
mirror of https://github.com/osmarks/mycorrhiza.git synced 2025-10-25 04:37:41 +00:00

Add /user-list page

This commit is contained in:
bouncepaw
2021-01-30 23:21:50 +05:00
parent ae1c5db3b3
commit e3b4c75f79
5 changed files with 300 additions and 92 deletions

View File

@@ -4,6 +4,7 @@ import (
"bytes"
"fmt"
"html"
"regexp"
"strings"
"unicode"
)
@@ -103,6 +104,17 @@ func getTextNode(input *bytes.Buffer) string {
return textNodeBuffer.String()
}
var (
dangerousSymbols = "<>{}|\\^[]`,()"
reLink = regexp.MustCompile(fmt.Sprintf(`[^[]{0,2}((https|http|gemini|gopher)://[^%[1]s]+)|(mailto:[^%[1]s]+)[^]]{0,2}`, dangerousSymbols))
)
// TODO:
func doRegexpStuff(input string) string {
reLink.ReplaceAllString(input, "[[$1]]")
return ""
}
func ParagraphToHtml(hyphaName, input string) string {
var (
p = bytes.NewBufferString(input)