discourse/app/assets/javascripts/admin/helpers/preserve-newlines.js
2020-09-04 13:42:47 +02:00

7 lines
205 B
JavaScript

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