DEV: Remove buffered render code

The render buffer code is being removed from core, so we need to remove
it's usage from this plugin. This change is a refactor only and should
not break any functionality.
This commit is contained in:
Blake Erickson 2020-01-10 16:20:40 -07:00
parent 86516dadbb
commit 45fbba08fc
2 changed files with 1 additions and 18 deletions

View File

@ -1,24 +1,6 @@
import { on, observes } from "ember-addons/ember-computed-decorators";
import debounce from "discourse/lib/debounce";
import highlightSyntax from "discourse/lib/highlight-syntax";
import { bufferedRender } from "discourse-common/lib/buffered-render";
export default Ember.Component.extend(
bufferedRender({
buildBuffer(buffer) {
buffer.push("<pre><code class='" + this.codeClass + "'>");
buffer.push(Handlebars.Utils.escapeExpression(this.value));
buffer.push("</code></pre>");
},
@observes("value")
_refreshHighlight: debounce(function() {
this.rerenderBuffer();
}, 50),
@on("didInsertElement")
_applyHighlight() {
highlightSyntax($(this.element));
}
})
);

View File

@ -0,0 +1 @@
<pre><code class={{codeClass}}>{{value}}</code></pre>