-
Notifications
You must be signed in to change notification settings - Fork 13.4k
Fix invalid HTML escape #46326
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix invalid HTML escape #46326
Conversation
src/librustdoc/html/render.rs
Outdated
name_len, | ||
indent: 0, | ||
})?; | ||
if w.alternate() { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What is this change for? item_function
is only used to produce HTML.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Because in the slidebar on the left, we call these function and escape the text once again. Guess what happens when you escape a string twice?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This function isn't used for rendering the sidebar. This piece of code is rendering the <pre>
block at the top of function pages.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes but does it hurt to have this? Seems logical that the alternate
handling is propagated to the children no? But if it's an issue, I'll just remove it.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
alternate
is never set so this is an issue because it's dead code.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ok, I'll just remove the update in here then.
src/librustdoc/html/render.rs
Outdated
indent, | ||
end_newline, | ||
}) | ||
if w.alternate() { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Again, what is this for?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This change still needs to be removed.
3b294f9
to
c1746ce
Compare
c1746ce
to
daec497
Compare
@ollie27: You were absolutely right, the first change was completely useless. It even allowed me to see that the url encoding was incomplete. Thanks for that too! :) |
daec497
to
35f5be6
Compare
@bors r+ |
📌 Commit 35f5be6 has been approved by |
Fix invalid HTML escape Fixes #46289. r? @QuietMisdreavus
☀️ Test successful - status-appveyor, status-travis |
Fixes #46289.
r? @QuietMisdreavus