diff options
author | bob <bcz@cs.brown.edu> | 2019-07-09 10:58:02 -0400 |
---|---|---|
committer | bob <bcz@cs.brown.edu> | 2019-07-09 10:58:02 -0400 |
commit | b49fdb1c42b9758e006521e0f404634ba396a2ac (patch) | |
tree | 12dce7a5d61bb203aaad2c378294f415ae722e44 /src/client/views/nodes/FormattedTextBox.tsx | |
parent | bc4e7ceb8a738b890344c4564ab0d97e0a10293d (diff) | |
parent | 326cf48bf28340d1533565a19236411c4091d3b4 (diff) |
Merge branch 'master' of https://github.com/browngraphicslab/Dash-Web
Diffstat (limited to 'src/client/views/nodes/FormattedTextBox.tsx')
-rw-r--r-- | src/client/views/nodes/FormattedTextBox.tsx | 5 |
1 files changed, 2 insertions, 3 deletions
diff --git a/src/client/views/nodes/FormattedTextBox.tsx b/src/client/views/nodes/FormattedTextBox.tsx index 68a4372d5..32bb97255 100644 --- a/src/client/views/nodes/FormattedTextBox.tsx +++ b/src/client/views/nodes/FormattedTextBox.tsx @@ -89,9 +89,8 @@ export class FormattedTextBox extends DocComponent<(FieldViewProps & FormattedTe } public static GetDocFromUrl(url: string) { if (url.startsWith(document.location.origin)) { - let start = url.indexOf(window.location.origin); - let path = url.substr(start, url.length - start); - let docid = path.replace(DocServer.prepend("/doc/"), "").split("?")[0]; + const split = new URL(url).pathname.split("doc/"); + const docid = split[split.length - 1]; return docid; } return ""; |