summaryrefslogtreecommitdiff
path: root/resources/js/helpers.js
diff options
context:
space:
mode:
Diffstat (limited to 'resources/js/helpers.js')
-rw-r--r--resources/js/helpers.js9
1 files changed, 9 insertions, 0 deletions
diff --git a/resources/js/helpers.js b/resources/js/helpers.js
index 58e2113..bceaf5e 100644
--- a/resources/js/helpers.js
+++ b/resources/js/helpers.js
@@ -14,6 +14,15 @@ function slugToName (slug) {
}
/**
+ * @param {string} text
+ *
+ * @returns {string}
+ */
+function nl2br (text) {
+ return text.replace(new RegExp(/\\n/g), '<br>');
+}
+
+/**
* @param {string} color
*
* @returns {string}