Skip to content

Commit

Permalink
Improve logic for determining search and hash
Browse files Browse the repository at this point in the history
  • Loading branch information
philippjfr authored Mar 1, 2022
1 parent f5cd620 commit 6a99676
Showing 1 changed file with 10 additions and 4 deletions.
14 changes: 10 additions & 4 deletions panel/io/state.py
Original file line number Diff line number Diff line change
Expand Up @@ -494,10 +494,16 @@ def location(self):
else:
loc = self._locations.get(self.curdoc) if self.curdoc else None

try:
loc.search = self.base_url.replace("/", "")
except Exception:
pass
if '?' in self.base_url:
try:
loc.search = f'?{self.base_url.split("?")[-1].strip("/")}'
except Exception:
pass
if '#' in self.base_url:
try:
loc.hash = f'#{self.base_url.split("#")[-1].strip("/")}'
except Exception:
pass

return loc

Expand Down

0 comments on commit 6a99676

Please sign in to comment.