about summary refs log tree commit diff
path: root/src/librustdoc/html/render
diff options
context:
space:
mode:
authorGuillaume Gomez <guillaume.gomez@huawei.com>2022-04-03 13:40:43 +0200
committerGuillaume Gomez <guillaume.gomez@huawei.com>2022-04-03 13:40:43 +0200
commit78698dd0fbdf7772fca2b203ae262de00e268f37 (patch)
tree40890cf93d8169fd8fd60c289178a5d5d562e2d1 /src/librustdoc/html/render
parent0677edc86e342f333d4828b0ee1ef395a4e70fe5 (diff)
downloadrust-78698dd0fbdf7772fca2b203ae262de00e268f37.tar.gz
rust-78698dd0fbdf7772fca2b203ae262de00e268f37.zip
Fix display of attributes in rustdoc
Diffstat (limited to 'src/librustdoc/html/render')
-rw-r--r--src/librustdoc/html/render/mod.rs7
1 files changed, 6 insertions, 1 deletions
diff --git a/src/librustdoc/html/render/mod.rs b/src/librustdoc/html/render/mod.rs
index 93b33b0d609..42d818e20a8 100644
--- a/src/librustdoc/html/render/mod.rs
+++ b/src/librustdoc/html/render/mod.rs
@@ -1002,7 +1002,12 @@ fn attributes(it: &clean::Item) -> Vec<String> {
         .iter()
         .filter_map(|attr| {
             if ALLOWED_ATTRIBUTES.contains(&attr.name_or_empty()) {
-                Some(pprust::attribute_to_string(attr).replace('\n', "").replace("  ", " "))
+                Some(
+                    pprust::attribute_to_string(attr)
+                        .replace("\\\n", "")
+                        .replace('\n', "")
+                        .replace("  ", " "),
+                )
             } else {
                 None
             }