discourse/app/assets/javascripts/admin/addon/helpers/preserve-newlines.js

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

7 lines
205 B
JavaScript
Raw Normal View History

import { escapeExpression } from "discourse/lib/utilities";
import { htmlHelper } from "discourse-common/lib/helpers";
export default htmlHelper((str) =>
escapeExpression(str).replace(/\n/g, "<br>")
);