diff --git a/app/assets/javascripts/discourse/components/d-editor.js.es6 b/app/assets/javascripts/discourse/components/d-editor.js.es6 index 1fcb1b76162..c4cc4f88a32 100644 --- a/app/assets/javascripts/discourse/components/d-editor.js.es6 +++ b/app/assets/javascripts/discourse/components/d-editor.js.es6 @@ -301,6 +301,9 @@ export default Ember.Component.extend({ $editorInput.autocomplete({ template: template, key: ":", + afterComplete(text) { + self.set('value', text); + }, transformComplete(v) { if (v.code) { diff --git a/app/assets/javascripts/discourse/lib/autocomplete.js.es6 b/app/assets/javascripts/discourse/lib/autocomplete.js.es6 index 5de68382117..0d158734bd5 100644 --- a/app/assets/javascripts/discourse/lib/autocomplete.js.es6 +++ b/app/assets/javascripts/discourse/lib/autocomplete.js.es6 @@ -146,6 +146,10 @@ export default function(options) { text = text.substring(0, completeStart) + (options.key || "") + term + ' ' + text.substring(completeEnd + 1, text.length); me.val(text); Discourse.Utilities.setCaretPosition(me[0], completeStart + 1 + term.length); + + if (options && options.afterComplete) { + options.afterComplete(text); + } } } } diff --git a/app/assets/javascripts/discourse/templates/discovery.hbs b/app/assets/javascripts/discourse/templates/discovery.hbs index 1e4548bbe26..069be994bad 100644 --- a/app/assets/javascripts/discourse/templates/discovery.hbs +++ b/app/assets/javascripts/discourse/templates/discovery.hbs @@ -27,3 +27,5 @@ + +{{plugin-outlet "discovery-below"}}