This commit is contained in:
@@ -204,6 +204,7 @@ export default {
|
|||||||
},
|
},
|
||||||
getSelectedRange(forceBlock) {
|
getSelectedRange(forceBlock) {
|
||||||
let bodyTextArea = this.$refs.editArea.$el.querySelector("textarea");
|
let bodyTextArea = this.$refs.editArea.$el.querySelector("textarea");
|
||||||
|
// debugger;
|
||||||
this.selection.start = bodyTextArea.selectionStart;
|
this.selection.start = bodyTextArea.selectionStart;
|
||||||
this.selection.end = bodyTextArea.selectionEnd;
|
this.selection.end = bodyTextArea.selectionEnd;
|
||||||
|
|
||||||
@@ -232,6 +233,9 @@ export default {
|
|||||||
);
|
);
|
||||||
if (indexOfLineFeed != -1) {
|
if (indexOfLineFeed != -1) {
|
||||||
this.selection.startOfBlock = 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";
|
return this.wikiVisible ? "fa-eye-slash" : "fa-eye";
|
||||||
},
|
},
|
||||||
compiledOutput() {
|
compiledOutput() {
|
||||||
|
if (this.localVal.length == 0) {
|
||||||
|
return "";
|
||||||
|
}
|
||||||
return DOMPurify.sanitize(marked(this.localVal, { breaks: true }));
|
return DOMPurify.sanitize(marked(this.localVal, { breaks: true }));
|
||||||
},
|
},
|
||||||
clickBold() {
|
clickBold() {
|
||||||
|
|||||||
Reference in New Issue
Block a user