From 85546b5f0feb185942c3e9911b36aa04e5ac46be Mon Sep 17 00:00:00 2001 From: andig Date: Sun, 1 Oct 2023 14:58:00 +0200 Subject: [PATCH] Fix generating docs for templates with multi-line help (#10138) --- templates/definition/meter/lg-ess-home-8-10.yaml | 10 ++++++---- util/templates/documentation.go | 3 ++- 2 files changed, 8 insertions(+), 5 deletions(-) diff --git a/templates/definition/meter/lg-ess-home-8-10.yaml b/templates/definition/meter/lg-ess-home-8-10.yaml index f07a59d43..2ecd69c60 100644 --- a/templates/definition/meter/lg-ess-home-8-10.yaml +++ b/templates/definition/meter/lg-ess-home-8-10.yaml @@ -10,10 +10,12 @@ params: - name: host - name: password help: - en: | - User password, see https://github.com/Morluktom/ioBroker.lg-ess-home/tree/master#getting-the-password.Alteratively, use registration id for admin login. - de: | - Benutzerpasswort, siehe https://github.com/Morluktom/ioBroker.lg-ess-home/tree/master#getting-the-password.Alterativ kann die Registriernummer für Administratorlogin verwendet werden. + en: > + User password, see https://github.com/Morluktom/ioBroker.lg-ess-home/tree/master#getting-the-password. + Alteratively, use registration id for admin login. + de: > + Benutzerpasswort, siehe https://github.com/Morluktom/ioBroker.lg-ess-home/tree/master#getting-the-password. + Alterativ kann die Registriernummer für Administratorlogin verwendet werden. - name: registration advanced: true example: "DE200..." diff --git a/util/templates/documentation.go b/util/templates/documentation.go index 77b46f4db..3754bb140 100644 --- a/util/templates/documentation.go +++ b/util/templates/documentation.go @@ -4,6 +4,7 @@ import ( "bytes" _ "embed" "fmt" + "strings" "text/template" "github.com/Masterminds/sprig/v3" @@ -108,6 +109,6 @@ func (t *Template) RenderDocumentation(product Product, lang string) ([]byte, er func localize(lang string) func(TextLanguage) string { return func(s TextLanguage) string { - return s.String(lang) + return strings.TrimSpace(s.String(lang)) } }