Skip to content

Commit

Permalink
bugfix
Browse files Browse the repository at this point in the history
  • Loading branch information
Alex014 committed Dec 9, 2018
1 parent c91eaf6 commit 0ad4866
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
6 changes: 3 additions & 3 deletions darkblog/lib/parser.php
Original file line number Diff line number Diff line change
Expand Up @@ -153,12 +153,12 @@ public static function build($text, $post_name, $vars) {

$text_final = '';
$atext_final = array();
$atext = preg_split("/\r\n|\n|\r/", $text);
$atext = preg_split("/\s+/", $text);

$next_part = '';
foreach ($atext as $part) {
if(strlen($next_part.PHP_EOL.$part) < self::$BLOCK_SIZE) {
$next_part .= PHP_EOL.$part;
if(strlen($next_part.' '.$part) < self::$BLOCK_SIZE) {
$next_part .= ' '.$part;
}
else {
$atext_final[] = $next_part;
Expand Down
2 changes: 2 additions & 0 deletions templates/post.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,9 @@
<div class="panel panel-default">
<div class="panel-heading">
<h3 class="panel-title"><?=nl2br(strip_tags($post['title']))?></h3>
<? if(!empty($post['replies'])): ?>
<a href="/post.php?name=<?=$post['name']?>&full" style="position: absolute; right: 32px; top: 10px;"> [Show Full] </a>
<? endif; ?>
</div>
<div class="panel-body">
<?=nl2br(trim($post['content']))?>
Expand Down

0 comments on commit 0ad4866

Please sign in to comment.