rustdoc: HTML escape const values
This commit is contained in:
parent
cd8377d37e
commit
e2305d0055
4 changed files with 26 additions and 5 deletions
|
@ -2279,7 +2279,7 @@ fn item_constant(w: &mut Buffer, cx: &Context, it: &clean::Item, c: &clean::Cons
|
|||
);
|
||||
|
||||
if c.value.is_some() || c.is_literal {
|
||||
write!(w, " = {expr};", expr = c.expr);
|
||||
write!(w, " = {expr};", expr = Escape(&c.expr));
|
||||
} else {
|
||||
write!(w, ";");
|
||||
}
|
||||
|
@ -2292,7 +2292,7 @@ fn item_constant(w: &mut Buffer, cx: &Context, it: &clean::Item, c: &clean::Cons
|
|||
if value_lowercase != expr_lowercase
|
||||
&& value_lowercase.trim_end_matches("i32") != expr_lowercase
|
||||
{
|
||||
write!(w, " // {value}", value = value);
|
||||
write!(w, " // {value}", value = Escape(value));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue