From e6c4f2e0779bebe5d21fa79f10ddd1c6ca7cd4bc Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Josu=C3=A9=20Tille?= Date: Thu, 29 Feb 2024 22:49:41 +0100 Subject: [PATCH] Use signe quote to return value to config panel Following the specification of yaml (https://yaml.org/spec/1.2.2/#single-quoted-style), when we use single quote we only need to escapte signle quote. By this we avoid to need to excape mulitple other chars wich could be complicated. --- helpers/config | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/helpers/config b/helpers/config index fbf7febaa..d2cc2760e 100644 --- a/helpers/config +++ b/helpers/config @@ -151,7 +151,7 @@ for panel_name, panel in loaded_toml.items(): bind_section = bind_section + bind_panel_file else: bind_section = regex + bind_section + bind_panel_file - + for name, param in section.items(): if not isinstance(param, dict): continue @@ -204,8 +204,7 @@ _ynh_app_config_show() { ynh_return "${short_setting}:" ynh_return "$(echo "${old[$short_setting]}" | sed 's/^/ /g')" else - ynh_return "${short_setting}: "'"'"$(echo "${old[$short_setting]}" | sed 's/"/\\"/g' | sed ':a;N;$!ba;s/\n/\n\n/g')"'"' - + ynh_return "${short_setting}: '$(echo "${old[$short_setting]}" | sed "s/'/''/g" | sed ':a;N;$!ba;s/\n/\n\n/g')'" fi fi done