attempting regex to remove \n
authorAnthony Talarico <talarico@gaslightmedia.com>
Mon, 23 Nov 2015 20:44:32 +0000 (15:44 -0500)
committerAnthony Talarico <talarico@gaslightmedia.com>
Mon, 23 Nov 2015 20:44:32 +0000 (15:44 -0500)
search.php

index 5807e44..6a84b80 100644 (file)
 
                                 // Highlight matches
                                 $context = nl2br(preg_replace('/'.str_replace('/', '\/', join('|', $terms)).'/i', '<strong>$0</strong>', $output));
+                                $noNewLine = preg_replace('/[\n\r]+/', '', $context);
                                 ?>
 
                                 <p class="search_result_context">
-                                  <?php echo $context ?>
+                                  <?php echo $noNewLine ?>
                                 </p>
                               
                 <!-- End of the Contextual/Highlight Search -->