From 4c799f736f25c2c049c16448074de266c2eba4b6 Mon Sep 17 00:00:00 2001 From: Federico Terzi Date: Sat, 14 Nov 2020 21:11:46 +0100 Subject: [PATCH] Add support for escaped brakets in form fields. Fix #503 --- src/matcher/mod.rs | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/matcher/mod.rs b/src/matcher/mod.rs index 955e43c..c8f8286 100644 --- a/src/matcher/mod.rs +++ b/src/matcher/mod.rs @@ -177,6 +177,9 @@ impl<'a> From<&'a AutoMatch> for Match { }); let new_replace = new_replace.to_string(); + // Convert escaped brakets in forms + let form = form.replace("\\{", "{ ").replace("\\}", " }"); + // Convert the form data to valid variables let mut params = Mapping::new(); if let Some(fields) = &other.form_fields { @@ -186,7 +189,7 @@ impl<'a> From<&'a AutoMatch> for Match { }); params.insert(Value::from("fields"), Value::from(mapping_fields)); } - params.insert(Value::from("layout"), Value::from(form.to_owned())); + params.insert(Value::from("layout"), Value::from(form)); let vars = vec![MatchVariable { name: "form1".to_owned(),