mirror of
https://github.com/discourse/discourse.git
synced 2025-02-25 18:55:32 -06:00
FIX: generates markdown from pasting link (#21241)
After removing `TextareaTextManipulation` from `ChatComposer` and using `TextareaInteractor` as a proxy, one function has been forgotten: `paste(event)` which is not available in glimmer components anymore, and even less avaiable now that the mixin is not tied to a component anymore but a real DOM node. As a solution we now add a manual paste event listener which will call `paste(event)`.
This commit is contained in:
@@ -402,10 +402,12 @@ export default Mixin.create({
|
||||
plainText = plainText.replace(/\r/g, "");
|
||||
const table = this.extractTable(plainText);
|
||||
if (table) {
|
||||
this.appEvents.trigger(
|
||||
`${this.composerEventPrefix}:insert-text`,
|
||||
table
|
||||
);
|
||||
this.composerEventPrefix
|
||||
? this.appEvents.trigger(
|
||||
`${this.composerEventPrefix}:insert-text`,
|
||||
table
|
||||
)
|
||||
: this.insertText(table);
|
||||
handled = true;
|
||||
}
|
||||
}
|
||||
@@ -457,10 +459,12 @@ export default Mixin.create({
|
||||
}
|
||||
|
||||
if (isComposer) {
|
||||
this.appEvents.trigger(
|
||||
`${this.composerEventPrefix}:insert-text`,
|
||||
markdown
|
||||
);
|
||||
this.composerEventPrefix
|
||||
? this.appEvents.trigger(
|
||||
`${this.composerEventPrefix}:insert-text`,
|
||||
markdown
|
||||
)
|
||||
: this.insertText(markdown);
|
||||
handled = true;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user