mirror of
https://github.com/discourse/discourse.git
synced 2025-06-18 07:02:28 +08:00
DEV: Support for import Handlebars from 'handlebars'
; (#9600)
* Remove Handlebars.SafeString usage * DEV: Support for `import Handlebars from 'handlebars'`; * FIX: Sprockets was broken when `node_modules` was present By default the old version of sprockets looks for application.js anywhere, including in a node_modules folder if this exists (which it will when we move to Ember CLI.)
This commit is contained in:
@ -1,6 +1,7 @@
|
||||
import { get } from "@ember/object";
|
||||
import Helper from "@ember/component/helper";
|
||||
import RawHandlebars from "discourse-common/lib/raw-handlebars";
|
||||
import { htmlSafe } from "@ember/template";
|
||||
|
||||
export function makeArray(obj) {
|
||||
if (obj === null || obj === undefined) {
|
||||
@ -13,7 +14,7 @@ export function htmlHelper(fn) {
|
||||
return Helper.helper(function(...args) {
|
||||
args =
|
||||
args.length > 1 ? args[0].concat({ hash: args[args.length - 1] }) : args;
|
||||
return new Handlebars.SafeString(fn.apply(this, args) || "");
|
||||
return htmlSafe(fn.apply(this, args) || "");
|
||||
});
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user