mirror of
https://github.com/askama-rs/askama.git
synced 2025-09-27 13:00:57 +00:00
Put Raw::lit
field into a span
This commit is contained in:
parent
54be12a6e0
commit
89024013dd
@ -1135,7 +1135,7 @@ impl<'a> Lit<'a> {
|
||||
#[derive(Debug, PartialEq)]
|
||||
pub struct Raw<'a> {
|
||||
pub ws1: Ws,
|
||||
pub lit: Lit<'a>,
|
||||
pub lit: WithSpan<'a, Lit<'a>>,
|
||||
pub ws2: Ws,
|
||||
}
|
||||
|
||||
@ -1187,7 +1187,7 @@ impl<'a> Raw<'a> {
|
||||
);
|
||||
|
||||
let (pws, (nws, (ws2, content))) = p.parse_next(i)?;
|
||||
let lit = Lit::split_ws_parts(content);
|
||||
let lit = WithSpan::new_with_full(Lit::split_ws_parts(content), content);
|
||||
let ws1 = Ws(pws, nws);
|
||||
Ok(Box::new(Node::Raw(WithSpan::new(
|
||||
Self { ws1, lit, ws2 },
|
||||
|
@ -1483,11 +1483,11 @@ fn test_raw() {
|
||||
.nodes,
|
||||
[Box::new(Node::Raw(WithSpan::no_span(Raw {
|
||||
ws1: Ws(Some(Whitespace::Preserve), Some(Whitespace::Suppress)),
|
||||
lit: Lit {
|
||||
lit: WithSpan::no_span(Lit {
|
||||
lws: " ",
|
||||
val,
|
||||
rws: " ",
|
||||
},
|
||||
}),
|
||||
ws2: Ws(Some(Whitespace::Minimize), Some(Whitespace::Minimize)),
|
||||
})))],
|
||||
);
|
||||
@ -1507,11 +1507,11 @@ fn test_raw() {
|
||||
.nodes,
|
||||
[Box::new(Node::Raw(WithSpan::no_span(Raw {
|
||||
ws1: Ws(Some(Whitespace::Suppress), Some(Whitespace::Suppress)),
|
||||
lit: Lit {
|
||||
lit: WithSpan::no_span(Lit {
|
||||
lws: " ",
|
||||
val: "-$- endraw",
|
||||
rws: " ",
|
||||
},
|
||||
}),
|
||||
ws2: Ws(None, Some(Whitespace::Suppress)),
|
||||
})))],
|
||||
);
|
||||
|
Loading…
x
Reference in New Issue
Block a user