From 9f0af1f2753655032a82b2517cdcebb4e8244236 Mon Sep 17 00:00:00 2001 From: Stephan Brunker Date: Fri, 22 May 2020 17:57:44 +0200 Subject: [PATCH] plugin nl2br: add newlines to improve readability of the output --- plugins/serendipity_event_nl2br/Changelog | 1 + .../serendipity_event_nl2br.php | 10 +++++----- 2 files changed, 6 insertions(+), 5 deletions(-) diff --git a/plugins/serendipity_event_nl2br/Changelog b/plugins/serendipity_event_nl2br/Changelog index 1afa6188..f0efd5f6 100644 --- a/plugins/serendipity_event_nl2br/Changelog +++ b/plugins/serendipity_event_nl2br/Changelog @@ -1,3 +1,4 @@ +2.21.7: * add some newlines in output to make it better humanly readable 2.21.6: * add missing 'u' inline element 2.21.5: * nl2p: if the double newline contains spaces, e.g. \n \n, these spaces are now ignored diff --git a/plugins/serendipity_event_nl2br/serendipity_event_nl2br.php b/plugins/serendipity_event_nl2br/serendipity_event_nl2br.php index 6e736456..80f12a6a 100644 --- a/plugins/serendipity_event_nl2br/serendipity_event_nl2br.php +++ b/plugins/serendipity_event_nl2br/serendipity_event_nl2br.php @@ -18,7 +18,7 @@ class serendipity_event_nl2br extends serendipity_event $propbag->add('description', PLUGIN_EVENT_NL2BR_DESC); $propbag->add('stackable', false); $propbag->add('author', 'Serendipity Team, Stephan Brunker'); - $propbag->add('version', '2.21.6'); + $propbag->add('version', '2.21.7'); $propbag->add('requirements', array( 'serendipity' => '1.6', 'smarty' => '2.6.7', @@ -772,7 +772,7 @@ p.wl_notopbottom { // concatenate closing tag if it's standard html if (in_array($tag, $this->isolation_block_elements) ) { - $content .= $textarray[$i]; + $content .= $textarray[$i] . "\n"; } } //closing blocktag or p parent - e.g. or @@ -786,11 +786,11 @@ p.wl_notopbottom { $content .= $this->nl2pblock(implode(array_slice($textarray,$start,$i-$start))) . "\n"; } else { - $content .= implode(array_slice($textarray,$start,$i-$start)); + $content .= implode(array_slice($textarray,$start,$i-$start)) . "\n"; } } //closing tag - $content .= $textarray[$i]; + $content .= $textarray[$i] . "\n"; $start = $i+1; array_shift($tagstack); @@ -902,7 +902,7 @@ p.wl_notopbottom { $bufferhastext = false; //append textline - $content .= $textline[$j]; + $content .= $textline[$j] . "\n"; //close open tags foreach($tagstack as $ins_tag) { $content .= $this->html_end_tag($this->extract_tag($ins_tag)); }