Parcourir la source

decodeURI for page anchor

Yuki Takei il y a 6 ans
Parent
commit
02c14c0db5
1 fichiers modifiés avec 3 ajouts et 3 suppressions
  1. 3 3
      src/client/js/components/Page/CopyDropdown.jsx

+ 3 - 3
src/client/js/components/Page/CopyDropdown.jsx

@@ -45,7 +45,7 @@ class CopyDropdown extends React.Component {
       search, hash,
       search, hash,
     } = window.location;
     } = window.location;
 
 
-    return `${pagePath}${search}${hash}`;
+    return decodeURI(`${pagePath}${search}${hash}`);
   }
   }
 
 
   generatePagePathUrl() {
   generatePagePathUrl() {
@@ -64,7 +64,7 @@ class CopyDropdown extends React.Component {
     const {
     const {
       origin, search, hash,
       origin, search, hash,
     } = location;
     } = location;
-    return `${origin}/${pageId}${search}${hash}`;
+    return decodeURI(`${origin}/${pageId}${search}${hash}`);
   }
   }
 
 
   generateMarkdownLink() {
   generateMarkdownLink() {
@@ -73,7 +73,7 @@ class CopyDropdown extends React.Component {
       search, hash,
       search, hash,
     } = window.location;
     } = window.location;
 
 
-    const label = `${pagePath}${search}${hash}`;
+    const label = decodeURI(`${pagePath}${search}${hash}`);
     const permalink = this.generatePermalink();
     const permalink = this.generatePermalink();
 
 
     return `[${label}](${permalink})`;
     return `[${label}](${permalink})`;