Skip to content

Commit 2de4edd

Browse files
authored
Decode URI component when retrieving the location hash (#255)
1 parent 404cdac commit 2de4edd

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

inst/rmarkdown/templates/flex_dashboard/resources/flexdashboard.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1202,14 +1202,14 @@ var FlexDashboard = (function () {
12021202
function handleLocationHash() {
12031203

12041204
// restore tab/page from bookmark
1205-
var hash = window.location.hash;
1205+
var hash = window.decodeURIComponent(window.location.hash);
12061206
if (hash.length > 0)
12071207
$('ul.nav a[href="' + hash + '"]').tab('show');
12081208
FlexDashboardUtils.manageActiveNavbarMenu();
12091209

12101210
// navigate to a tab when the history changes
12111211
window.addEventListener("popstate", function(e) {
1212-
var hash = window.location.hash;
1212+
var hash = window.decodeURIComponent(window.location.hash);
12131213
var activeTab = $('ul.nav a[href="' + hash + '"]');
12141214
if (activeTab.length) {
12151215
activeTab.tab('show');

0 commit comments

Comments
 (0)