remove nuking of hash changes when hash is disabled

edit
Hakim El Hattab 2020-05-08 20:53:05 +02:00
parent 772fa0308d
commit ba0b367ed9
3 changed files with 9 additions and 5 deletions

2
dist/reveal.esm.js vendored

File diff suppressed because one or more lines are too long

2
dist/reveal.js vendored

File diff suppressed because one or more lines are too long

View File

@ -131,12 +131,16 @@ export default class Location {
else if( config.hash ) { else if( config.hash ) {
window.history.replaceState( null, null, '#' + this.getHash() ); window.history.replaceState( null, null, '#' + this.getHash() );
} }
// UPDATE: The below nuking of all hash changes breaks
// anchors on pages where reveal.js is running. Removed
// in 4.0. Why was it here in the first place? ¯\_(ツ)_/¯
//
// If history and hash are both disabled, a hash may still // If history and hash are both disabled, a hash may still
// be added to the URL by clicking on a href with a hash // be added to the URL by clicking on a href with a hash
// target. Counter this by always removing the hash. // target. Counter this by always removing the hash.
else { // else {
window.history.replaceState( null, null, window.location.pathname + window.location.search ); // window.history.replaceState( null, null, window.location.pathname + window.location.search );
} // }
} }
} }