diff --git a/src/web/page/templates.rs b/src/web/page/templates.rs index 9da280509..7d3cffbd0 100644 --- a/src/web/page/templates.rs +++ b/src/web/page/templates.rs @@ -234,8 +234,10 @@ pub mod filters { Ok(value.split(pat).next()) } - pub fn json_encode(value: &T) -> rinja::Result { - Ok(serde_json::to_string(value).expect("`encode_json` failed")) + pub fn json_encode(value: &T) -> rinja::Result> { + Ok(Safe( + serde_json::to_string(value).expect("`encode_json` failed"), + )) } pub fn rest_menu_url(current_target: &str, inner_path: &str) -> rinja::Result { diff --git a/templates/rustdoc/topbar.html b/templates/rustdoc/topbar.html index 7eb80f079..b00e2fbe9 100644 --- a/templates/rustdoc/topbar.html +++ b/templates/rustdoc/topbar.html @@ -16,8 +16,8 @@ {# the only text that needs escaping in a {%- if krate is defined -%}