From 6cbeaa4a09e45a19de5f2a4f00a71f0469a25d8e Mon Sep 17 00:00:00 2001 From: qkqpttgf <45693631+qkqpttgf@users.noreply.github.com> Date: Wed, 22 Dec 2021 20:43:00 +0800 Subject: [PATCH] fix: url in preview --- theme/flatcard.html | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/theme/flatcard.html b/theme/flatcard.html index 16e4224..739f008 100644 --- a/theme/flatcard.html +++ b/theme/flatcard.html @@ -558,7 +558,9 @@ var $url = document.getElementById('url'); if ($url) { - $url.innerHTML = location.protocol + '//' + location.host + $url.innerHTML; + let url = location.href; + url = url.substr(0, url.length-8); + $url.innerHTML = url.replace(/&/g, '&amp;'); $url.style.height = $url.scrollHeight + 'px'; }