From 63e4b566f5a8273b1fba3eee11990b566bde7eb4 Mon Sep 17 00:00:00 2001 From: John Cardinal Date: Sat, 18 Apr 2020 19:40:45 +0000 Subject: [PATCH] --- ayanova/src/components/wiki-control.vue | 7 +++++++ 1 file changed, 7 insertions(+) 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() {