openidec

Unnamed repository; edit this file 'description' to name the repository.
Log | Files | Refs | README | LICENSE

commit e8653810a53fb85ee65b82eb7e1b5b6c241c54f4
parent 39942a4aa0f1510b8fa7ce2a8fd912e0e5247779
Author: Peter Kosyh <p.kosyh@gmail.com>
Date:   Sun, 18 Oct 2020 12:23:06 +0300

fmt header

Diffstat:
Mii-node/lib/style.css | 5+++++
Mii-node/web.go | 7+++++--
2 files changed, 10 insertions(+), 2 deletions(-)

diff --git a/ii-node/lib/style.css b/ii-node/lib/style.css @@ -271,6 +271,11 @@ body { color: #555555; font-style: italic; } + +.header { + font-weight: bold; +} + .spoiler { color: #cccccc; } diff --git a/ii-node/web.go b/ii-node/web.go @@ -790,9 +790,12 @@ func msg_text(m *ii.Msg) string { skip = 0 l = msg_esc(l) } else if strings.HasPrefix(l, "P.S.") || strings.HasPrefix(l, "PS:") || - strings.HasPrefix(l, "//") || strings.HasPrefix(l, "#") || - strings.HasPrefix(l, "+++ ") { + strings.HasPrefix(l, "//") || strings.HasPrefix(l, "+++ ") { l = fmt.Sprintf("<span class=\"comment\">%s</span>", str_esc(l)) + } else if strings.HasPrefix(l, "# ") || strings.HasPrefix(l, "= ") || + strings.HasPrefix(l, "## ") || strings.HasPrefix(l, "== ") || + strings.HasPrefix(l, "### ") || strings.HasPrefix(l, "=== ") { + l = fmt.Sprintf("<span class=\"header\">%s</span>", str_esc(l)) } else if strings.HasPrefix(l, "@spoiler:") { l = fmt.Sprintf("<span class=\"spoiler\">%s</span>", str_esc(ReverseStr(l))) } else if quoteRegex.MatchString(l) {