File tree Expand file tree Collapse file tree 4 files changed +16
-9
lines changed
documentRenderers/project Expand file tree Collapse file tree 4 files changed +16
-9
lines changed Original file line number Diff line number Diff line change @@ -172,7 +172,12 @@ const ProjectContainer = observer((props: Props) => {
172
172
// TODO: hardcoded fix for docs
173
173
path = identifiersToPath ( [
174
174
new HttpsIdentifier (
175
- uri . URI . parse ( window . location . protocol + "//" + window . location . host + "/_docs/" )
175
+ uri . URI . parse (
176
+ window . location . protocol +
177
+ "//" +
178
+ window . location . host +
179
+ "/_docs/"
180
+ )
176
181
) ,
177
182
// props.project.identifier,
178
183
item . data . identifier ,
Original file line number Diff line number Diff line change @@ -21,13 +21,17 @@ export const DocumentRoute = observer(
21
21
return < div > Loading</ div > ;
22
22
}
23
23
24
- const [ owner , workspace , ...documentParts ] = location . pathname
24
+ const [ owner , workspace , ...documentParts ] = decodeURIComponent (
25
+ location . pathname
26
+ )
25
27
. substring ( 1 )
26
28
. split ( "/" ) ;
27
29
const document = documentParts . join ( "/" ) ;
28
30
29
31
if ( ! owner || owner . length < 2 || ! owner . startsWith ( "@" ) ) {
30
- const identifiers = tryPathToIdentifiers ( location . pathname . substring ( 1 ) ) ;
32
+ const identifiers = tryPathToIdentifiers (
33
+ decodeURIComponent ( location . pathname ) . substring ( 1 )
34
+ ) ;
31
35
if ( identifiers !== "invalid-identifier" ) {
32
36
const [ id , ...subs ] = identifiers ;
33
37
return (
Original file line number Diff line number Diff line change @@ -204,7 +204,9 @@ export const OwnerAliasRoute = observer(
204
204
) ;
205
205
}
206
206
207
- const identifiers = pathToIdentifiers ( location . pathname . substring ( 1 ) ) ;
207
+ const identifiers = pathToIdentifiers (
208
+ decodeURIComponent ( location . pathname ) . substring ( 1 )
209
+ ) ;
208
210
const [ id , ...subs ] = identifiers ;
209
211
return (
210
212
< RouteContext . Provider
Original file line number Diff line number Diff line change @@ -210,12 +210,8 @@ export function getIdentifierWithAppendedPath(
210
210
pathToAppend : string
211
211
) : Identifier {
212
212
const uri = identifier . uri . with ( {
213
- path : path . join (
214
- identifier . uri . path || "/" ,
215
- encodeURIComponent ( pathToAppend )
216
- ) ,
213
+ path : path . join ( identifier . uri . path || "/" , pathToAppend ) ,
217
214
} ) ;
218
-
219
215
return parseUriIdentifier ( uri ) ;
220
216
}
221
217
You can’t perform that action at this time.
0 commit comments