Add namespaces and include tag, improve whitespace handling

This commit is contained in:
2023-10-29 15:47:47 -07:00
parent fb7010dae3
commit 76c0a48b87
12 changed files with 372 additions and 162 deletions

View File

@@ -56,15 +56,14 @@ func main() {
"page": Page{Title: "Users"},
}
t, err := salix.New().
WithVarMap(vars).
WithEscapeHTML(true).
ParseString("readme.salix.html", tmpl)
t, err := salix.New().ParseString("readme.salix.html", tmpl)
if err != nil {
log.Fatalln(err)
}
err = t.Execute(os.Stdout)
err = t.WithVarMap(vars).
WithEscapeHTML(true).
Execute(os.Stdout)
if err != nil {
log.Fatalln(err)
}

View File

@@ -23,13 +23,12 @@ func main() {
}
t, err := salix.New().
WithVarMap(vars).
ParseString("replybot.salix.txt", tmpl)
if err != nil {
log.Fatalln(err)
}
err = t.Execute(os.Stdout)
err = t.WithVarMap(vars).Execute(os.Stdout)
if err != nil {
log.Fatalln(err)
}

View File

@@ -1,4 +1,5 @@
#if(len(matches) > 1):Imgur links were#else:An Imgur link was#!if detected in your #(type). Here are links to the same #if(len(matches) > 1):locations#else:location#!if on alternative frontends that protect your privacy.
#for(i, match in matches):
#if(len(matches) > 1):Link #(i+1):#!if
- [imgur.artemislena.eu](https://imgur.artemislena.eu/#(match[1]))