Added surrounding quotes
This commit is contained in:
parent
878cbf56ca
commit
5463ed2cdf
@ -328,8 +328,12 @@ pub fn template(i: &str) -> IResult<&str, Template> {
|
|||||||
Ok((remaining, Template { contents: contents }))
|
Ok((remaining, Template { contents: contents }))
|
||||||
}
|
}
|
||||||
|
|
||||||
fn temp_string(i: &str) -> IResult<&str, &str> {
|
fn quoted_string(i: &str) -> IResult<&str, &str> {
|
||||||
escaped(is_not(r#"\""#), '\\', one_of(r#"\""#))(i)
|
delimited(
|
||||||
|
tag(r#"""#),
|
||||||
|
escaped(is_not(r#"\""#), '\\', one_of(r#"\""#)),
|
||||||
|
tag(r#"""#),
|
||||||
|
)(i)
|
||||||
}
|
}
|
||||||
|
|
||||||
#[cfg(test)]
|
#[cfg(test)]
|
||||||
@ -610,6 +614,6 @@ mod tests {
|
|||||||
|
|
||||||
#[test]
|
#[test]
|
||||||
fn test_temp_string() {
|
fn test_temp_string() {
|
||||||
assert_eq!(temp_string(r#"foo\"bar"#), Ok(("", r#"foo\"bar"#)));
|
assert_eq!(quoted_string(r#""foo\"bar""#), Ok(("", r#"foo\"bar"#)));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user