Don't Apply Quotes to Strings in .js or .json Files Used as Templates in MiniJinja

October 2025

TODO: Create Example using this to turn of autoescaping of .js and .json files so that data sent to them doesn't get escaped if you try to do something like { key: [_@ value @_] }

env.set_auto_escape_callback(|name| {
  if matches!(
    name.rsplit('.').next().unwrap_or(""),
    "html" | "htm"
  ) {
    AutoEscape::Html
  } else {
    AutoEscape::None
  }
});
end of line