From b8bab6fcf337e6c48437d45cf192e085e19cdf49 Mon Sep 17 00:00:00 2001 From: r Date: Thu, 27 Jan 2022 10:53:18 +0000 Subject: Highlight quotes --- renderer/renderer.go | 4 ++++ static/style.css | 4 ++++ 2 files changed, 8 insertions(+) diff --git a/renderer/renderer.go b/renderer/renderer.go index ec328dc..4911db9 100644 --- a/renderer/renderer.go +++ b/renderer/renderer.go @@ -3,6 +3,7 @@ package renderer import ( "fmt" "io" + "regexp" "strconv" "strings" "text/template" @@ -49,6 +50,8 @@ func emojiFilter(content string, emojis []mastodon.Emoji) string { return strings.NewReplacer(replacements...).Replace(content) } +var quoteRE = regexp.MustCompile("(?mU)(^|> *|\n)(>.*)( 0 { content = spoiler + "
" + content } + content = quoteRE.ReplaceAllString(content, "$1$2$3") for _, e := range emojis { r = fmt.Sprintf("\":%s:\"", e.URL, e.ShortCode, e.ShortCode) diff --git a/static/style.css b/static/style.css index cd7e98c..96c842f 100644 --- a/static/style.css +++ b/static/style.css @@ -575,6 +575,10 @@ kbd { position: fixed; } +.quote { + color: #789922; +} + .dark { background-color: #222222; background-image: none; -- cgit v1.2.3