monitoring: Transform markdown markup in comments

refs #3684
refs #3441
This commit is contained in:
Johannes Meyer 2019-06-04 15:23:52 +02:00
parent 1ac5557187
commit d4cf7a8ec4
8 changed files with 8 additions and 8 deletions

View File

@ -136,7 +136,7 @@ class EventController extends Controller
*/
protected function comment($message)
{
return $this->view->nl2br($this->view->createTicketLinks($this->view->escapeComment($message)));
return $this->view->nl2br($this->view->createTicketLinks($this->view->markdown($message)));
}
/**

View File

@ -45,7 +45,7 @@
</tr>
<tr title="<?= $this->translate('A comment, as entered by the author, associated with the scheduled downtime'); ?>">
<th><?= $this->translate('Comment') ?></th>
<td class="comment-text"><?= $this->nl2br($this->escapeComment($this->downtime->comment)) ?></td>
<td class="comment-text"><?= $this->nl2br($this->markdown($this->downtime->comment)) ?></td>
</tr>
</tbody>
</table>

View File

@ -66,5 +66,5 @@
</span>
</div>
<p class="comment-text"<?php if (isset($textId)): ?> id="<?= $textId ?>"<?php endif ?>>
<?= $this->nl2br($this->escapeComment($comment->comment)) ?>
<?= $this->nl2br($this->markdown($comment->comment)) ?>
</p>

View File

@ -82,6 +82,6 @@
</span>
</div>
<p class="comment-text"<?php if (isset($textId)): ?> id="<?= $textId ?>"<?php endif ?>>
<?= $this->nl2br($this->escapeComment($downtime->comment)) ?>
<?= $this->nl2br($this->markdown($downtime->comment)) ?>
</p>
</td>

View File

@ -182,7 +182,7 @@ $rowAction = Url::fromPath('monitoring/event/show');
<?php endif ?>
<p class="overview-plugin-output"><?php if ($icon) {
echo $this->icon($icon, $iconTitle);
} ?><?= $this->nl2br($this->createTicketLinks($this->escapeComment($msg)))
} ?><?= $this->nl2br($this->createTicketLinks($this->markdown($msg)))
// TODO(ak): this allows only a[href] in messages, but plugin output allows more
?></p>
</td>

View File

@ -44,7 +44,7 @@ $acknowledgement = $object->acknowledgement;
} ?>
</dt>
<dd>
<?= $this->nl2br($this->createTicketLinks($this->escapeComment($acknowledgement->getComment()))) ?>
<?= $this->nl2br($this->createTicketLinks($this->markdown($acknowledgement->getComment()))) ?>
</dd>
</dl>
<?php elseif (isset($removeAckForm)): ?>

View File

@ -68,7 +68,7 @@ if (empty($object->comments) && ! $addLink) {
} ?>
</dt>
<dd>
<?= $this->nl2br($this->createTicketLinks($this->escapeComment($comment->comment))) ?>
<?= $this->nl2br($this->createTicketLinks($this->markdown($comment->comment))) ?>
</dd>
<?php endforeach ?>
</dl>

View File

@ -108,7 +108,7 @@ if (empty($object->comments) && ! $addLink) {
} ?>
</dt>
<dd>
<?= $this->nl2br($this->createTicketLinks($this->escapeComment($downtime->comment))) ?>
<?= $this->nl2br($this->createTicketLinks($this->markdown($downtime->comment))) ?>
</dd>
<?php endforeach ?>
</dl>