diff --git a/web/src/components/inputs/FormatedText.vue b/web/src/components/inputs/FormatedText.vue index 460a262..89dee51 100644 --- a/web/src/components/inputs/FormatedText.vue +++ b/web/src/components/inputs/FormatedText.vue @@ -25,7 +25,7 @@ export default { methods: { rawhtml(value) { if (typeof this.format === 'function') { - return this.format(value); + return this.format(value.replace(/ /g, ' ')); } else { return value; } @@ -39,7 +39,7 @@ export default { this.selection.direction = sel.direction; this.selection.type = sel.type; } - this.$emit('input', event.target.innerText); + this.$emit('input', event.target.innerText.replace(/ /g, ' ')); }, calculateOffset(container, node, offset) { let position = 0; @@ -91,8 +91,6 @@ export default { watch: { value() { if (this.selection) { - console.log(this.selection); - const div = this.$refs.text; div.innerHTML = this.rawhtml(this.value); @@ -103,8 +101,6 @@ export default { sel.removeAllRanges(); sel.addRange(range); - console.log(range, sel); - } } },