Explorar o código

fix #26

decode `location.pathname`
Yuki Takei %!s(int64=9) %!d(string=hai) anos
pai
achega
46bd735c20
Modificáronse 2 ficheiros con 10 adicións e 2 borrados
  1. 5 1
      resource/js/legacy/crowi-form.js
  2. 5 1
      resource/js/legacy/crowi.js

+ 5 - 1
resource/js/legacy/crowi-form.js

@@ -78,7 +78,11 @@ $(function() {
     var parsedHTML = crowiRenderer.render(markdown, rendererOptions);
 
     // create context object
-    var context = {markdown, parsedHTML, currentPagePath: location.pathname};
+    var context = {
+      markdown,
+      parsedHTML,
+      currentPagePath: decodeURIComponent(location.pathname)
+    };
 
     // process interceptors for pre rendering
     crowi.interceptorManager.process('preRenderPreview', context)   // process with the context

+ 5 - 1
resource/js/legacy/crowi.js

@@ -429,7 +429,11 @@ $(function() {
       var parsedHTML = crowiRenderer.render(markdown, rendererOptions);
 
       // create context object
-      var context = {markdown, parsedHTML, currentPagePath: location.pathname};
+      var context = {
+        markdown,
+        parsedHTML,
+        currentPagePath: decodeURIComponent(location.pathname)
+      };
 
       // process interceptors for pre rendering
       crowi.interceptorManager.process('preRender', context)   // process with the context