mirror of
https://github.com/discourse/discourse.git
synced 2025-05-25 00:32:52 +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:
@ -7,6 +7,7 @@ import Mixin from "@ember/object/mixin";
|
||||
import showModal from "discourse/lib/show-modal";
|
||||
import { Promise } from "rsvp";
|
||||
import { ajax } from "discourse/lib/ajax";
|
||||
import { htmlSafe } from "@ember/template";
|
||||
|
||||
const CUSTOM_TYPES = [
|
||||
"bool",
|
||||
@ -63,7 +64,7 @@ export default Mixin.create({
|
||||
}
|
||||
let preview = setting.get("preview");
|
||||
if (preview) {
|
||||
return new Handlebars.SafeString(
|
||||
return htmlSafe(
|
||||
"<div class='preview'>" +
|
||||
preview.replace(/\{\{value\}\}/g, value) +
|
||||
"</div>"
|
||||
|
Reference in New Issue
Block a user