diff --git a/docs/helpers/environment-variable-docs-generator.go.tmpl b/docs/helpers/environment-variable-docs-generator.go.tmpl
index bf640ec058b..c2cac9c7f84 100644
--- a/docs/helpers/environment-variable-docs-generator.go.tmpl
+++ b/docs/helpers/environment-variable-docs-generator.go.tmpl
@@ -2,6 +2,7 @@ package main
import (
"fmt"
+ "html"
"io/ioutil"
"log"
"os"
@@ -76,7 +77,7 @@ func GetAnnotatedVariables(s interface{}) []ConfigField {
continue
}
v := fmt.Sprintf("%v", value.Interface())
- fields = append(fields, ConfigField{Name: strings.ReplaceAll(env, ";", "
"), DefaultValue: v, Description: desc, Type: value.Type().Name()})
+ fields = append(fields, ConfigField{Name: strings.ReplaceAll(env, ";", "
"), DefaultValue: html.EscapeString(strings.Replace(v, "|", "\\|", -1)), Description: desc, Type: value.Type().Name()})
case reflect.Ptr:
// PolicySelectors in the Proxy are being skipped atm
// they are not configurable via env vars, if that changes