* fixed conf parsing: variables can now be omitted from the config
* fix newlines: use CRLF on windows
* bump version

---------

Co-authored-by: Thomas von Dein <tom@vondein.org>
This commit is contained in:
T.v.Dein
2023-12-18 20:18:37 +01:00
committed by Thomas von Dein
parent 1c6d832b20
commit ae5e3daea3
3 changed files with 24 additions and 13 deletions

View File

@@ -22,6 +22,7 @@ import (
"log/slog"
"os"
"path/filepath"
"runtime"
"strings"
tpl "text/template"
)
@@ -41,7 +42,11 @@ func WriteAd(dir string, ad *Ad, template string) error {
return err
}
ad.Text = strings.ReplaceAll(ad.Text, "<br/>", "\n")
if runtime.GOOS == "windows" {
ad.Text = strings.ReplaceAll(ad.Text, "<br/>", "\r\n")
} else {
ad.Text = strings.ReplaceAll(ad.Text, "<br/>", "\n")
}
tmpl, err := tpl.New("adlisting").Parse(template)
if err != nil {