0
0
Fork 1
Spiegel von https://github.com/paviliondev/discourse-custom-wizard.git synchronisiert 2024-11-22 09:20:29 +01:00

COMPATIBILITY: new editor helper fn signatures

See 94207e27d1
Dieser Commit ist enthalten in:
Angus McLeod 2022-04-22 15:46:32 +03:00
Ursprung 0b6ba868ce
Commit 449b81a93e

Datei anzeigen

@ -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,