Skip to content

Commit bc50852

Browse files
committed
Implemented Markdown syntax - server-status-project#8
1 parent 9d8e4ef commit bc50852

File tree

3 files changed

+4
-1
lines changed

3 files changed

+4
-1
lines changed

admin/index.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@
88
require_once("../config.php");
99
require_once("../classes/constellation.php");
1010
require_once("../template.php");
11+
require_once("../libs/parsedown/Parsedown.php");
1112

1213
if(isset($_COOKIE['user'])&&!isset($_SESSION['user']))
1314
{

classes/incident.php

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -170,6 +170,7 @@ public function render($admin=0){
170170
global $icons;
171171
global $classes, $user;
172172
$admin = $admin && (($user->get_rank()<=1) || ($user->get_username() == $this->username));
173+
$Parsedown = new Parsedown();
173174
?>
174175
<article class="panel panel-<?php echo $classes[$this->type];?>">
175176
<div class="panel-heading icon">
@@ -183,7 +184,7 @@ public function render($admin=0){
183184
<time class="pull-right timeago" datetime="<?php echo $this->date; ?>"><?php echo $this->date; ?></time>
184185
</div>
185186
<div class="panel-body">
186-
<?php echo $this->text; ?>
187+
<?php echo $Parsedown->setBreaksEnabled(true)->text($this->text); ?>
187188
</div>
188189
<div class="panel-footer clearfix">
189190
<small><?php echo _("Posted by");?>: <?php echo $this->username;

index.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@
99

1010
require_once("config.php");
1111
require_once("classes/constellation.php");
12+
require_once("libs/parsedown/Parsedown.php");
1213

1314
$offset = 0;
1415

0 commit comments

Comments
 (0)