some improvements

This commit is contained in:
ston1th 2019-07-30 18:57:16 +02:00
commit d9d089be0d
8 changed files with 132 additions and 24 deletions

View file

@ -13,6 +13,8 @@ import (
"strings"
)
const delim = "+"
var filter = makeFilter()
func makeFilter() analysis.CharFilter {
@ -40,7 +42,11 @@ func Render(p *core.Page) string {
}
func Title(title string) string {
return whiteSpace.ReplaceAllString(titleRe.ReplaceAllString(title, ""), "+")
return whiteSpace.ReplaceAllString(titleRe.ReplaceAllString(title, ""), delim)
}
func Untitle(title string) string {
return strings.ReplaceAll(title, delim, " ")
}
func StoreTitle(section, title string) string {