@hyperbook/markdown 0.33.1 → 0.33.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -4,7 +4,7 @@ hyperbook.webide = (function () {
4
4
  codeInput.templates.prism(window.Prism, [
5
5
  new codeInput.plugins.AutoCloseBrackets(),
6
6
  new codeInput.plugins.Indent(true, 2),
7
- ])
7
+ ]),
8
8
  );
9
9
 
10
10
  const elems = document.getElementsByClassName("directive-webide");
@@ -71,7 +71,9 @@ hyperbook.webide = (function () {
71
71
 
72
72
  const load = async () => {
73
73
  const result = await store.webide.get(id);
74
- if (!result) return;
74
+ if (!result) {
75
+ return;
76
+ }
75
77
  const website = template
76
78
  .replace("###HTML###", result.html)
77
79
  .replace("###CSS###", result.css)
@@ -94,7 +96,7 @@ hyperbook.webide = (function () {
94
96
  .replace("###JS###", editorJS?.value);
95
97
  frame.srcdoc = website;
96
98
  };
97
-
99
+
98
100
  frame.addEventListener("load", () => {
99
101
  title.textContent = frame.contentDocument.title;
100
102
  });
@@ -105,6 +107,8 @@ hyperbook.webide = (function () {
105
107
  editorHTML.value = result.html;
106
108
  }
107
109
 
110
+ update();
111
+
108
112
  editorHTML.addEventListener("input", () => {
109
113
  update();
110
114
  });
@@ -116,6 +120,8 @@ hyperbook.webide = (function () {
116
120
  editorCSS.value = result.css;
117
121
  }
118
122
 
123
+ update();
124
+
119
125
  editorCSS.addEventListener("input", () => {
120
126
  update();
121
127
  });
@@ -127,6 +133,8 @@ hyperbook.webide = (function () {
127
133
  editorJS.value = result.js;
128
134
  }
129
135
 
136
+ update();
137
+
130
138
  editorJS.addEventListener("input", () => {
131
139
  update();
132
140
  });