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) 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>
<tr title="<?= $this->translate('A comment, as entered by the author, associated with the scheduled downtime'); ?>"> <tr title="<?= $this->translate('A comment, as entered by the author, associated with the scheduled downtime'); ?>">
<th><?= $this->translate('Comment') ?></th> <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> </tr>
</tbody> </tbody>
</table> </table>

View File

@ -66,5 +66,5 @@
</span> </span>
</div> </div>
<p class="comment-text"<?php if (isset($textId)): ?> id="<?= $textId ?>"<?php endif ?>> <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> </p>

View File

@ -82,6 +82,6 @@
</span> </span>
</div> </div>
<p class="comment-text"<?php if (isset($textId)): ?> id="<?= $textId ?>"<?php endif ?>> <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> </p>
</td> </td>

View File

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

View File

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

View File

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

View File

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