mirror of
https://github.com/discourse/discourse.git
synced 2024-11-22 08:57:10 -06:00
DEV: Deprecate htmlHelper
(#29495)
This commit is contained in:
parent
33b2845adc
commit
ae8d919528
@ -1,4 +1,6 @@
|
||||
import { htmlHelper } from "discourse-common/lib/helpers";
|
||||
import { htmlSafe } from "@ember/template";
|
||||
import I18n from "discourse-i18n";
|
||||
|
||||
export default htmlHelper((size) => I18n.toHumanSize(size));
|
||||
export default function (size) {
|
||||
return htmlSafe(I18n.toHumanSize(size));
|
||||
}
|
||||
|
@ -13,6 +13,11 @@ export function makeArray(obj) {
|
||||
}
|
||||
|
||||
export function htmlHelper(fn) {
|
||||
deprecated(
|
||||
`htmlHelper is deprecated. Use a plain function and \`htmlSafe()\` from "@ember/template" instead.`,
|
||||
{ id: "discourse.html-helper" }
|
||||
);
|
||||
|
||||
return Helper.helper(function (...args) {
|
||||
args =
|
||||
args.length > 1 ? args[0].concat({ hash: args[args.length - 1] }) : args;
|
||||
|
Loading…
Reference in New Issue
Block a user