Skip to content

Commit a8989f4

Browse files
authored
Updated Scriptor.js 🖊️
1 parent dfb577d commit a8989f4

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

src/scriptor.js

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,8 @@ const defaultButtonProps = {
1313

1414
const form = document.getElementById('text-editor');
1515

16-
if (!form) return;
16+
if (form != null){
17+
let DEBUG = false;
1718
// carot / last type postion
1819
let startPosition = 0;
1920
let currentTextPosition = 0;
@@ -42,7 +43,7 @@ function handleClick(button, form) {
4243
}
4344

4445
function getNewValue(button, text) {
45-
const [insert, htmltags, wrap] = ['insert', 'htmltags', 'wrap'].map((key) => checkBool(button.getAttribute(key) ?? defaultButtonProps[key]));
46+
const [insert, htmltags, wrap] = ['insert', 'htmltags', 'wrap'].map((key) => checkBool(button.getAttribute(key.toLowerCase()) ?? defaultButtonProps[key]));
4647
const value = button.getAttribute('value') ?? defaultButtonProps['value'];
4748
DEBUG && console.table({ insert, value, htmltags, wrap });
4849

@@ -103,3 +104,4 @@ function wrapText(text, wrap, html_tags = true) {
103104
function checkBool(x) {
104105
return x === 'true' || x === true;
105106
}
107+
}

0 commit comments

Comments
 (0)