Spiegel von
https://github.com/paviliondev/discourse-custom-wizard.git
synchronisiert 2024-11-22 17:30:29 +01:00
Ursprung
0b6ba868ce
Commit
449b81a93e
1 geänderte Dateien mit 4 neuen und 4 gelöschten Zeilen
|
@ -114,13 +114,13 @@ export default {
|
||||||
|
|
||||||
_wizardInsertText(args = {}) {
|
_wizardInsertText(args = {}) {
|
||||||
if (args.fieldId === this.fieldId) {
|
if (args.fieldId === this.fieldId) {
|
||||||
this._insertText(args.text, args.options);
|
this.insertText(args.text, args.options);
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
_wizardReplaceText(args = {}) {
|
_wizardReplaceText(args = {}) {
|
||||||
if (args.fieldId === this.fieldId) {
|
if (args.fieldId === this.fieldId) {
|
||||||
this._replaceText(args.oldVal, args.newVal, (args.opts = {}));
|
this.replaceText(args.oldVal, args.newVal, (args.opts = {}));
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
|
@ -139,7 +139,7 @@ export default {
|
||||||
let html = clipboard.getData("text/html");
|
let html = clipboard.getData("text/html");
|
||||||
let handled = false;
|
let handled = false;
|
||||||
|
|
||||||
const { pre, lineVal } = this._getSelected(null, { lineVal: true });
|
const { pre, lineVal } = this.getSelected(null, { lineVal: true });
|
||||||
const isInlinePasting = pre.match(/[^\n]$/);
|
const isInlinePasting = pre.match(/[^\n]$/);
|
||||||
const isCodeBlock = isInside(pre, /(^|\n)```/g);
|
const isCodeBlock = isInside(pre, /(^|\n)```/g);
|
||||||
|
|
||||||
|
@ -150,7 +150,7 @@ export default {
|
||||||
!isCodeBlock
|
!isCodeBlock
|
||||||
) {
|
) {
|
||||||
plainText = plainText.trim().replace(/\r/g, "");
|
plainText = plainText.trim().replace(/\r/g, "");
|
||||||
const table = this._extractTable(plainText);
|
const table = this.extractTable(plainText);
|
||||||
if (table) {
|
if (table) {
|
||||||
this.appEvents.trigger("wizard-editor:insert-text", {
|
this.appEvents.trigger("wizard-editor:insert-text", {
|
||||||
fieldId: this.fieldId,
|
fieldId: this.fieldId,
|
||||||
|
|
Laden …
In neuem Issue referenzieren