From 5163d8a1c74bfc58c40b30b59a25eb8523db7bc5 Mon Sep 17 00:00:00 2001 From: cpq Date: Mon, 20 Apr 2026 10:55:18 +0100 Subject: [PATCH] Panel fix --- mongoose.h | 2 +- src/dash.h | 2 +- tutorials/device-dashboard/settings-panel/server.c | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/mongoose.h b/mongoose.h index 2994c2ce..131cefc4 100644 --- a/mongoose.h +++ b/mongoose.h @@ -3250,7 +3250,7 @@ static inline bool mg_parse_field(struct mg_str json, struct mg_field *f, } else if (f->type == MG_VAL_DBL) { ok = mg_json_get_num(json, "$", &val->d); } else if (f->type == MG_VAL_STR) { - val->s = trimq(json); + val->s = json; } else if (f->type == MG_VAL_FN) { val->s = json; } diff --git a/src/dash.h b/src/dash.h index 40b112bf..b09e3097 100644 --- a/src/dash.h +++ b/src/dash.h @@ -112,7 +112,7 @@ static inline bool mg_parse_field(struct mg_str json, struct mg_field *f, } else if (f->type == MG_VAL_DBL) { ok = mg_json_get_num(json, "$", &val->d); } else if (f->type == MG_VAL_STR) { - val->s = trimq(json); + val->s = json; } else if (f->type == MG_VAL_FN) { val->s = json; } diff --git a/tutorials/device-dashboard/settings-panel/server.c b/tutorials/device-dashboard/settings-panel/server.c index 0e418228..b9bb9f37 100644 --- a/tutorials/device-dashboard/settings-panel/server.c +++ b/tutorials/device-dashboard/settings-panel/server.c @@ -16,7 +16,7 @@ static void location_get(union mg_val *val) { val->s = mg_str(s_location); } static void location_set(const union mg_val *val) { - mg_json_unescape(val->s, s_location, sizeof(s_location)); + mg_json_unescape(val->s, "$", s_location, sizeof(s_location)); } static void threshold_get(union mg_val *val) {