all repos — honk @ 998b83397c497093dc69ac8dbd04c56c5d68b219

my fork of honk

handle markdown in bios better
Ted Unangst tedu@tedunangst.com
Fri, 25 Sep 2020 19:02:26 -0400
commit

998b83397c497093dc69ac8dbd04c56c5d68b219

parent

258d92cba3b4cec98cdfb7733323f09c6d226d57

5 files changed, 12 insertions(+), 6 deletions(-)

jump to
M activity.goactivity.go

@@ -1410,8 +1410,6 @@ }

} func junkuser(user *WhatAbout) junk.Junk { - about := markitzero(user.About) - j := junk.New() j["@context"] = itiswhatitis j["id"] = user.URL

@@ -1419,7 +1417,7 @@ j["inbox"] = user.URL + "/inbox"

j["outbox"] = user.URL + "/outbox" j["name"] = user.Display j["preferredUsername"] = user.Name - j["summary"] = about + j["summary"] = user.HTAbout if user.ID > 0 { j["type"] = "Person" j["url"] = user.URL
M database.godatabase.go

@@ -20,6 +20,7 @@ "bytes"

"database/sql" "encoding/json" "fmt" + "html/template" "log" "sort" "strconv"

@@ -29,6 +30,7 @@

"humungus.tedunangst.com/r/webs/cache" "humungus.tedunangst.com/r/webs/httpsig" "humungus.tedunangst.com/r/webs/login" + "humungus.tedunangst.com/r/webs/mz" ) func userfromrow(row *sql.Row) (*WhatAbout, error) {

@@ -53,6 +55,11 @@ }

if user.Options.Reaction == "" { user.Options.Reaction = "none" } + var marker mz.Marker + marker.HashLinker = ontoreplacer + marker.AtLinker = attoreplacer + user.HTAbout = template.HTML(marker.Mark(user.About)) + return user, nil }
M docs/changelog.txtdocs/changelog.txt

@@ -2,6 +2,8 @@ changelog

=== next ++ Better support for rich text bios. + + Follow and unfollow should work a little better. ++ backup command.
M honk.gohonk.go

@@ -40,6 +40,7 @@ ID int64

Name string Display string About string + HTAbout template.HTML Key string URL string Options UserOptions
M web.goweb.go

@@ -701,9 +701,7 @@ u := login.GetUserInfo(r)

honks := gethonksbyuser(name, u != nil && u.Username == name, 0) templinfo := getInfo(r) templinfo["Name"] = user.Name - whatabout := user.About - whatabout = markitzero(user.About) - templinfo["WhatAbout"] = template.HTML(whatabout) + templinfo["WhatAbout"] = user.HTAbout templinfo["ServerMessage"] = "" templinfo["HonkCSRF"] = login.GetCSRF("honkhonk", r) honkpage(w, u, honks, templinfo)