From a0b032ad4b68f95ba8af39ed183534dcdb6bf1ab Mon Sep 17 00:00:00 2001 From: Tom Alexander Date: Mon, 6 Apr 2020 20:45:39 -0400 Subject: [PATCH] I was missing an escape character --- src/parser/parser.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/parser/parser.rs b/src/parser/parser.rs index 175d9ba..54db026 100644 --- a/src/parser/parser.rs +++ b/src/parser/parser.rs @@ -329,7 +329,7 @@ pub fn template(i: &str) -> IResult<&str, Template> { } fn temp_string(i: &str) -> IResult<&str, &str> { - escaped(is_not("\""), '\\', one_of(r#""\"#))(i) + escaped(is_not("\"\\"), '\\', one_of("\"\\"))(i) } #[cfg(test)] @@ -610,6 +610,6 @@ mod tests { #[test] fn test_temp_string() { - assert_eq!(temp_string("foo\"bar"), Ok(("", "foo\"bar"))); + assert_eq!(temp_string("foo\\\"bar"), Ok(("", "foo\\\"bar"))); } }