File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -12,7 +12,7 @@ use std::io::Read;
1212use std:: path:: PathBuf ;
1313use tokio:: sync:: oneshot;
1414
15- use minijinja:: { path_loader, Environment } ;
15+ use minijinja:: { path_loader, AutoEscape , Environment } ;
1616use std:: sync:: { Arc , OnceLock , RwLock } ;
1717
1818use syntect:: html:: { ClassStyle , ClassedHTMLGenerator } ;
5757 }
5858
5959 let mut env = Environment :: new ( ) ;
60+ env. set_auto_escape_callback ( |_| AutoEscape :: Html ) ;
6061 env. set_loader ( loader) ;
6162 env. add_template_owned ( "template" . to_string ( ) , source. to_string ( ) ) ?;
6263 cache. insert ( hash, Arc :: new ( env) ) ;
@@ -685,6 +686,7 @@ impl Command for MjCommand {
685686
686687 // Set up environment and get template
687688 let mut env = Environment :: new ( ) ;
689+ env. set_auto_escape_callback ( |_| AutoEscape :: Html ) ;
688690 let tmpl = if let Some ( ref path) = file {
689691 // File mode: resolve from filesystem only
690692 let path = std:: path:: Path :: new ( path) ;
You can’t perform that action at this time.
0 commit comments