URI decode bugfix

This commit is contained in:
DarkCat09 2022-08-11 17:42:30 +04:00
parent 7cd2503c46
commit e0629a750a

View file

@ -40,8 +40,10 @@
<script>
let h1 = document.querySelector('h1');
let h4 = document.querySelector('h4');
h1.textContent = (location.search.match(/[?&]title=(.*?)(?:[?&]|\/|$)/) || {1: ''})[1];
h4.textContent = (location.search.match(/[?&]text=(.*?)(?:[?&]|\/|$)/) || {1: ''})[1];
let caption = (location.search.match(/[?&]title=(.*?)(?:[?&]|\/|$)/) || {1: ''})[1];
let content = (location.search.match(/[?&]text=(.*?)(?:[?&]|\/|$)/) || {1: ''})[1];
h1.textContent = decodeURIComponent(caption);
h4.textContent = decodeURIComponent(content);
if (location.search.match(/[?&]theme=dark/))
document.body.classList.add('dark');
</script>