Yuki Takei 9 лет назад
Родитель
Сommit
5a02429fe2

+ 1 - 1
packages/growi-plugin-lsx/package.json

@@ -33,7 +33,7 @@
     "crowi-pluginkit": "^1.0.3",
     "react": "^15.4.2",
     "react-dom": "^15.4.2",
-    "urlgrey": "^0.4.4"
+    "url": "^0.11.0"
   },
   "devDependencies": {
     "babel-cli": "^6.23.0",

+ 2 - 3
packages/growi-plugin-lsx/src/resource/js/components/Lsx.jsx

@@ -1,5 +1,5 @@
 import React from 'react';
-import urlgrey from 'urlgrey';
+import * as url from 'url';
 
 import styles from '../../css/index.css';
 
@@ -144,8 +144,7 @@ export class Lsx extends React.Component {
   }
 
   getParentPath(path) {
-    const parent = urlgrey(path).parent();
-    return decodeURIComponent(this.addSlashOfEnd(parent.path()));
+    return this.addSlashOfEnd(decodeURIComponent(url.resolve(path, '../')));
   }
 
   render() {

+ 1 - 1
packages/growi-plugin-lsx/src/resource/js/util/LsxContext.js

@@ -60,7 +60,7 @@ export class LsxContext {
     //   when `fromPagePath`=/hoge and `specifiedPath`=undefined,
     //        `pagePath` to be /hoge
     this.pagePath = (specifiedPath !== undefined) ?
-        url.resolve(this.addSlashOfEnd(this.fromPagePath), specifiedPath):
+        decodeURIComponent(url.resolve(this.addSlashOfEnd(this.fromPagePath), specifiedPath)):
         this.fromPagePath;
 
     this.isParsed = true;