aboutsummaryrefslogtreecommitdiff
path: root/editor/editor.ts
diff options
context:
space:
mode:
authorShulhan <ms@kilabit.info>2021-08-29 14:50:55 +0700
committerShulhan <ms@kilabit.info>2021-08-29 14:50:55 +0700
commitb72a7d013229c7879f3bcc09b7d9e6bc0f3339f4 (patch)
tree53b3045980fbd1b0eb2f961ce54261c6c551cfed /editor/editor.ts
parent1364ab29de697993bc34832cf77d4e99ee037223 (diff)
downloadpakakeh.ts-b72a7d013229c7879f3bcc09b7d9e6bc0f3339f4.tar.xz
editor: always decode the node content from base64
Diffstat (limited to 'editor/editor.ts')
-rw-r--r--editor/editor.ts4
1 files changed, 3 insertions, 1 deletions
diff --git a/editor/editor.ts b/editor/editor.ts
index 8f175ac..e8883c4 100644
--- a/editor/editor.ts
+++ b/editor/editor.ts
@@ -333,10 +333,12 @@ export class WuiEditor {
}
}
+ // Open the node for editing.
+ // The content MUST be encoded in base64.
Open(node: WuiVfsNodeInterface): void {
this.active_file = node
- let content = node.content as string
+ let content = atob(node.content || "")
content = content.replace("\r\n", "\n")
this.raw_lines = content.split("\n")