Identified an issue where tags separated by only whitespace are breaking parsing.
This commit is contained in:
parent
f97bb25ca8
commit
7670db9259
@ -132,7 +132,7 @@ pub struct Body<'a> {
|
|||||||
pub elements: Vec<TemplateElement<'a>>,
|
pub elements: Vec<TemplateElement<'a>>,
|
||||||
}
|
}
|
||||||
|
|
||||||
#[derive(Clone, Debug)]
|
#[derive(Clone, Debug, PartialEq)]
|
||||||
pub struct Template<'a> {
|
pub struct Template<'a> {
|
||||||
pub contents: Body<'a>,
|
pub contents: Body<'a>,
|
||||||
}
|
}
|
||||||
@ -976,4 +976,31 @@ mod tests {
|
|||||||
))
|
))
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#[test]
|
||||||
|
fn test_temp_full_document() {
|
||||||
|
assert_eq!(
|
||||||
|
super::template(
|
||||||
|
"- simple -{~n}
|
||||||
|
{#names}{.}{/names}
|
||||||
|
{~n}- new lines -{~n}
|
||||||
|
{#names}
|
||||||
|
{.}
|
||||||
|
{/names}"
|
||||||
|
),
|
||||||
|
Ok::<_, nom::Err<(&str, ErrorKind)>>((
|
||||||
|
"",
|
||||||
|
Template {
|
||||||
|
contents: Body {
|
||||||
|
elements: vec![
|
||||||
|
TemplateElement::TESpan(Span {
|
||||||
|
contents: vec!["- simple -"]
|
||||||
|
}),
|
||||||
|
TemplateElement::TETag(DustTag::DTSpecial(Special::NewLine))
|
||||||
|
]
|
||||||
|
}
|
||||||
|
}
|
||||||
|
))
|
||||||
|
);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user