Skip to content

Commit 49d4d32

Browse files
authored
Merge pull request #292 from toy/navigate-to-complete-url
navigate to complete url instead of only fragment/hash
2 parents 24fb723 + f9ac4ec commit 49d4d32

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

src/utils/common-utils.js

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -149,7 +149,10 @@ export function replaceState(rawElementId) {
149149
const query = new URLSearchParams(currentQuery);
150150
query.delete('route');
151151
const newQuery = query.toString().length > 1 ? `${query.toString()}&route=${elementId}` : `route=${elementId}`;
152-
window.history.pushState(null, null, `#${currentNavigationHashPart}?${newQuery}`);
152+
153+
const fragment = `#${currentNavigationHashPart}?${newQuery}`;
154+
const url = new URL(fragment, window.location.href);
155+
window.history.pushState(null, null, url.href);
153156
}
154157

155158
export function toMarkdown(markdownStringRaw) {

0 commit comments

Comments
 (0)