-
Notifications
You must be signed in to change notification settings - Fork 12.7k
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 regression introduced by jQuery removal #42080
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -215,14 +215,14 @@ | |
} else if (ev.target.tagName === 'SPAN' && hasClass(ev.target.parentNode, 'line-numbers')) { | ||
var prev_id = 0; | ||
|
||
function set_fragment(name) { | ||
var set_fragment = function (name) { | ||
if (browserSupportsHistoryApi()) { | ||
history.replaceState(null, null, '#' + name); | ||
window.hashchange(); | ||
} else { | ||
location.replace('#' + name); | ||
} | ||
} | ||
}; | ||
|
||
var cur_id = parseInt(ev.target.id, 10); | ||
|
||
|
@@ -685,7 +685,7 @@ | |
} | ||
|
||
function escape(content) { | ||
let h1 = document.createElement('h1'); | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. out of curiosity, which browser are you using that doesn't support There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Opera 12. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Opera 12 is from 2012, so that makes sense. 😅 I don't mind making this change, as it's pretty small, but it is very unlikely that we won't end up doing something that breaks it in the future. |
||
var h1 = document.createElement('h1'); | ||
h1.textContent = content; | ||
return h1.innerHTML; | ||
} | ||
|
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.
why is this change needed?
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 ES5 does not allow function declaration here.
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.
it's not clear to me why ES5 wouldn't accept this, but not a big deal, seems fine to me
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.
For example: http://stackoverflow.com/a/25111212
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.
oh interesting! wasn't aware of that detail, thanks for sharing!