aboutsummaryrefslogtreecommitdiffstats
path: root/askama_derive/src/parser/node.rs
diff options
context:
space:
mode:
Diffstat (limited to 'askama_derive/src/parser/node.rs')
-rw-r--r--askama_derive/src/parser/node.rs11
1 files changed, 11 insertions, 0 deletions
diff --git a/askama_derive/src/parser/node.rs b/askama_derive/src/parser/node.rs
index 9f8b37b..fc6860e 100644
--- a/askama_derive/src/parser/node.rs
+++ b/askama_derive/src/parser/node.rs
@@ -14,6 +14,7 @@ use super::{
tag_block_end, tag_block_start, tag_comment_end, tag_comment_start, tag_expr_end,
tag_expr_start, take_content, ws, Expr, State,
};
+use crate::config::WhitespaceHandling;
#[derive(Debug, PartialEq)]
pub(crate) enum Node<'a> {
@@ -55,6 +56,16 @@ pub(crate) enum Whitespace {
Minimize,
}
+impl From<WhitespaceHandling> for Whitespace {
+ fn from(ws: WhitespaceHandling) -> Self {
+ match ws {
+ WhitespaceHandling::Suppress => Whitespace::Suppress,
+ WhitespaceHandling::Preserve => Whitespace::Preserve,
+ WhitespaceHandling::Minimize => Whitespace::Minimize,
+ }
+ }
+}
+
#[derive(Debug, PartialEq)]
pub(crate) struct Loop<'a> {
pub(crate) ws1: Ws,