summaryrefslogtreecommitdiff
path: root/model/Post.php
diff options
context:
space:
mode:
Diffstat (limited to 'model/Post.php')
-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",