Skip to content

Commit 7140b53

Browse files
authored
Merge pull request #304 from AJIXuMuK/field-name-preview
Fix of #296
2 parents 09e6b0d + cc37331 commit 7140b53

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

src/controls/fields/fieldNameRenderer/FieldNameRenderer.tsx

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -118,8 +118,9 @@ export class FieldNameRenderer extends React.Component<IFieldNameRendererProps,
118118
else {
119119
let url: string;
120120
const filePath = this.props.filePath;
121+
const parentPath = filePath.substring(0, filePath.lastIndexOf('/'));
121122
if (this.props.hasPreview !== false) {
122-
url = `#id=${filePath}&parent=${filePath.substring(0, filePath.lastIndexOf('/'))}`;
123+
url = `#id=${encodeURIComponent(filePath)}&parent=${encodeURIComponent(parentPath)}`;
123124
}
124125
else {
125126
url = filePath;

0 commit comments

Comments
 (0)