Skip to content

Commit

Permalink
Implemented Markdown syntax - server-status-project#8
Browse files Browse the repository at this point in the history
  • Loading branch information
thnilsen committed Nov 8, 2018
1 parent 9d8e4ef commit bc50852
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 1 deletion.
1 change: 1 addition & 0 deletions admin/index.php
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
require_once("../config.php");
require_once("../classes/constellation.php");
require_once("../template.php");
require_once("../libs/parsedown/Parsedown.php");

if(isset($_COOKIE['user'])&&!isset($_SESSION['user']))
{
Expand Down
3 changes: 2 additions & 1 deletion classes/incident.php
Original file line number Diff line number Diff line change
Expand Up @@ -170,6 +170,7 @@ public function render($admin=0){
global $icons;
global $classes, $user;
$admin = $admin && (($user->get_rank()<=1) || ($user->get_username() == $this->username));
$Parsedown = new Parsedown();
?>
<article class="panel panel-<?php echo $classes[$this->type];?>">
<div class="panel-heading icon">
Expand All @@ -183,7 +184,7 @@ public function render($admin=0){
<time class="pull-right timeago" datetime="<?php echo $this->date; ?>"><?php echo $this->date; ?></time>
</div>
<div class="panel-body">
<?php echo $this->text; ?>
<?php echo $Parsedown->setBreaksEnabled(true)->text($this->text); ?>
</div>
<div class="panel-footer clearfix">
<small><?php echo _("Posted by");?>: <?php echo $this->username;
Expand Down
1 change: 1 addition & 0 deletions index.php
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@

require_once("config.php");
require_once("classes/constellation.php");
require_once("libs/parsedown/Parsedown.php");

$offset = 0;

Expand Down

0 comments on commit bc50852

Please sign in to comment.