summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorcflip <36554078+cflip@users.noreply.github.com>2021-04-07 16:44:17 -0600
committercflip <36554078+cflip@users.noreply.github.com>2021-04-07 16:44:17 -0600
commitd2e1ff339323b558d87bff7cf9da557152600797 (patch)
tree4a3933f90533b4e02c99b4903a69196106798e27
parentf260b75bf64eb90f15c3d9c55636e3ca08d84e5e (diff)
Replace newlines with HTML breaks
-rw-r--r--model/Post.php3
1 files changed, 3 insertions, 0 deletions
diff --git a/model/Post.php b/model/Post.php
index 02c9dec..91cd3be 100644
--- a/model/Post.php
+++ b/model/Post.php
@@ -68,6 +68,9 @@ class Post {
return add_quote($dbc, $thread_id, $matches);
}, $post_content);
+ // Replace newline characters with HTML <br> tags
+ $post_content = nl2br($post_content);
+
// Replace YouTube URLs with embedded YouTube videos.
$post_content = preg_replace(
"/\s*[a-zA-Z\/\/:\.]*youtu(be.com\/watch\?v=|.be\/)([a-zA-Z0-9\-_]+)([a-zA-Z0-9\/\*\-\_\?\&\;\%\=\.]*)/i",