aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorShulhan <ms@kilabit.info>2021-08-30 10:07:58 +0700
committerShulhan <ms@kilabit.info>2021-08-30 10:07:58 +0700
commit57922f603f6acdfbd54c610279ab024c73d7650d (patch)
treed3f4ec269cb9c89246c4acb8876f96b7ecbdde8b
parent7dcf086fe48f7a1690122418b7f7108e7be9c6a2 (diff)
downloadpakakeh.ts-57922f603f6acdfbd54c610279ab024c73d7650d.tar.xz
editor: fix example converting the content to base64
-rw-r--r--editor/editor.ts2
-rw-r--r--editor/example.html4
2 files changed, 3 insertions, 3 deletions
diff --git a/editor/editor.ts b/editor/editor.ts
index fe73050..20afdf1 100644
--- a/editor/editor.ts
+++ b/editor/editor.ts
@@ -337,7 +337,7 @@ export class WuiEditor {
Open(node: WuiVfsNodeInterface): void {
this.active_file = node
- let content = atob(node.content || "")
+ let content = atob(node.content)
content = content.replace("\r\n", "\n")
this.raw_lines = content.split("\n")
diff --git a/editor/example.html b/editor/example.html
index c4eef27..8763dbc 100644
--- a/editor/example.html
+++ b/editor/example.html
@@ -16,7 +16,7 @@
let nodeFile = {
name: "Test",
path: "/test",
- content: `mkdir -p \${HOME}/aur/stackdriver-collectd
+ content: btoa(`mkdir -p \${HOME}/aur/stackdriver-collectd
git -C \${HOME}/aur/stackdriver-collectd clone \\
ssh://aur@aur.archlinux.org/stackdriver-collectd.git .
@@ -46,7 +46,7 @@ sudo systemctl status stackdriver-collectd
sudo systemctl restart telegraf
sudo systemctl status telegraf
-`,
+`),
}
function main() {