diff --git a/dev/index.html b/dev/index.html new file mode 100644 index 0000000..b196334 --- /dev/null +++ b/dev/index.html @@ -0,0 +1,38 @@ + + + + + + Code Plugin Test | EditorJS + + +
+ + + + + diff --git a/package.json b/package.json index 9805a62..d884738 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@editorjs/code", - "version": "2.9.2", + "version": "2.9.3", "keywords": [ "codex editor", "code", diff --git a/src/index.ts b/src/index.ts index 4607e20..ac9098d 100644 --- a/src/index.ts +++ b/src/index.ts @@ -188,7 +188,7 @@ export default class CodeTool implements BlockTool { this._data = data; if (this.nodes.textarea) { - this.nodes.textarea.textContent = data.code; + this.nodes.textarea.value = data.code; } } @@ -299,7 +299,7 @@ export default class CodeTool implements BlockTool { wrapper.classList.add(this.CSS.baseClass, this.CSS.wrapper); textarea.classList.add(this.CSS.textarea, this.CSS.input); - textarea.textContent = this.data.code; + textarea.value = this.data.code; textarea.placeholder = this.placeholder; diff --git a/vite.config.js b/vite.config.js index 9ad3bcd..a45847a 100644 --- a/vite.config.js +++ b/vite.config.js @@ -15,6 +15,9 @@ export default { fileName: 'code', }, }, + server: { + open: './dev/index.html', + }, define: { NODE_ENV: JSON.stringify(NODE_ENV), VERSION: JSON.stringify(VERSION),