This commit is contained in:
2020-04-18 16:30:49 +00:00
parent 9e71436ae8
commit 0f96351f5b

View File

@@ -318,7 +318,7 @@ export default {
return this.wikiVisible ? "fa-eye-slash" : "fa-eye"; return this.wikiVisible ? "fa-eye-slash" : "fa-eye";
}, },
compiledOutput() { compiledOutput() {
return DOMPurify.sanitize(marked(this.localVal)); return DOMPurify.sanitize(marked(this.localVal, { breaks: true }));
}, },
clickBold() { clickBold() {
this.getSelectedRange(); this.getSelectedRange();
@@ -375,9 +375,9 @@ export default {
this.getSelectedRange(); this.getSelectedRange();
if (this.selection.hasSelection) { if (this.selection.hasSelection) {
let s = this.getSelectedBlock(); let s = this.getSelectedBlock();
// console.log("Selected block:[" + s + "]");
let ret = ""; let ret = "\n1. ";
let listItem = 0; let listItem = 1;
for (let i = 0; i < s.length; i++) { for (let i = 0; i < s.length; i++) {
if (s[i] == "\n") { if (s[i] == "\n") {
++listItem; ++listItem;
@@ -386,7 +386,8 @@ export default {
ret += s[i]; ret += s[i];
} }
} }
ret += "\n"; ret += "\n\n";
// console.log("RET:[" + ret + "]");
this.replaceSelectedBlock(ret); this.replaceSelectedBlock(ret);
} else { } else {
this.replaceSelectedText("\n1. "); this.replaceSelectedText("\n1. ");
@@ -402,6 +403,7 @@ export default {
/** /**
todo: all editing controls enabled todo: all editing controls enabled
- add image and link - add image and link
- determine how local images will be handled (attachments) - determine how local images will be handled (attachments)