-
Notifications
You must be signed in to change notification settings - Fork 4k
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
Don't escape markup sensitive characters in <title> #5788
Conversation
Ahh, just realized |
@@ -10,7 +10,7 @@ | |||
<% if @shell %> | |||
<script defer> | |||
if (!document.title) { | |||
document.title = document.getElementsByTagName("TITLE")[1].innerHTML | |||
document.title = document.getElementsByTagName("TITLE")[1].textContent |
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.
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.
I'm a little late to this but I don't think this is no longer an issue @nickytonline
@nickytonline is still an issue in your opinion? The article that prompted this issue related to this PR seems fine: https://dev.to/astrit/why-how-did-i-build-500-css-only-icons-library-a-life-story-34on |
@rhymes it is. |
@Defman21 my mistake! For some reason I thought the issue was about the title we display, not the 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.
Sorry for the delay. Tested locally. LGTM!
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.
Looks good, thanks!
What type of PR is this? (check all applicable)
Description
Avoids broken titles like
The DEV <> Stackbit integration is in the running for a Product Hunt "Golden Kitty Award"
by replacing.innerHTML
with.textContent
which gets a raw copy of text node content.❗️This bug only appears when articles are not accessed via internal navigation.
Related Tickets & Documents
Closes #5226
Mobile & Desktop Screenshots/Recordings (if there are UI changes)
Added to documentation?
[optional] What gif best describes this PR or how it makes you feel?