From c74f2dc5884985ec93f77263769bc26eb0f472d9 Mon Sep 17 00:00:00 2001 From: clubby789 Date: Mon, 20 Mar 2023 05:21:51 +0000 Subject: [PATCH] Fix improper escaping of deprecation reasons --- src/librustdoc/html/templates/short_item_info.html | 2 +- tests/rustdoc/deprecated.rs | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/librustdoc/html/templates/short_item_info.html b/src/librustdoc/html/templates/short_item_info.html index e3125af0e47..75d155e91c2 100644 --- a/src/librustdoc/html/templates/short_item_info.html +++ b/src/librustdoc/html/templates/short_item_info.html @@ -2,7 +2,7 @@ {% when Self::Deprecation with { message } %}
{# #} 👎 {# #} - {{message}} {# #} + {{message|safe}} {# #}
{# #} {% when Self::Unstable with { feature, tracking } %}
{# #} diff --git a/tests/rustdoc/deprecated.rs b/tests/rustdoc/deprecated.rs index 51860441b35..9c9c0945b8f 100644 --- a/tests/rustdoc/deprecated.rs +++ b/tests/rustdoc/deprecated.rs @@ -28,6 +28,6 @@ pub struct W; // @matches deprecated/struct.X.html '//*[@class="stab deprecated"]' \ -// 'Deprecated: shorthand reason$' -#[deprecated = "shorthand reason"] +// 'Deprecated: shorthand reason: code$' +#[deprecated = "shorthand reason: `code`"] pub struct X;