diff --git a/ayanova/src/components/wiki-control.vue b/ayanova/src/components/wiki-control.vue index d3ecb136..ba25e85d 100644 --- a/ayanova/src/components/wiki-control.vue +++ b/ayanova/src/components/wiki-control.vue @@ -204,6 +204,7 @@ export default { }, getSelectedRange(forceBlock) { let bodyTextArea = this.$refs.editArea.$el.querySelector("textarea"); + // debugger; this.selection.start = bodyTextArea.selectionStart; this.selection.end = bodyTextArea.selectionEnd; @@ -232,6 +233,9 @@ export default { ); if (indexOfLineFeed != -1) { this.selection.startOfBlock = indexOfLineFeed + 1; + } else { + //this may be wrong but if it's the first line then I think the block should be the first character + this.selection.startOfBlock = 0; } } @@ -371,6 +375,9 @@ export default { return this.wikiVisible ? "fa-eye-slash" : "fa-eye"; }, compiledOutput() { + if (this.localVal.length == 0) { + return ""; + } return DOMPurify.sanitize(marked(this.localVal, { breaks: true })); }, clickBold() {