diff --git a/library/Icinga/Web/View/helpers/string.php b/library/Icinga/Web/View/helpers/string.php
index bec504750..5e3b06849 100644
--- a/library/Icinga/Web/View/helpers/string.php
+++ b/library/Icinga/Web/View/helpers/string.php
@@ -14,6 +14,12 @@ $this->addHelperFunction('nl2br', function ($string) {
return nl2br(str_replace(array('\r\n', '\r', '\n'), '
', $string), false);
});
-$this->addHelperFunction('markdown', function ($content) {
- return Markdown::text($content);
+$this->addHelperFunction('markdown', function ($content, $containerAttribs = null) {
+ if (! isset($containerAttribs['class'])) {
+ $containerAttribs['class'] = 'markdown';
+ } else {
+ $containerAttribs['class'] .= ' markdown';
+ }
+
+ return '
id="= $textId ?>"> - = $this->nl2br($this->markdown($comment->comment)) ?> -
+= $this->nl2br($this->markdown($comment->comment, isset($textId) ? ['id' => $textId] : null)) ?> diff --git a/modules/monitoring/application/views/scripts/partials/downtime/downtime-header.phtml b/modules/monitoring/application/views/scripts/partials/downtime/downtime-header.phtml index cda2dce05..9e733f7aa 100644 --- a/modules/monitoring/application/views/scripts/partials/downtime/downtime-header.phtml +++ b/modules/monitoring/application/views/scripts/partials/downtime/downtime-header.phtml @@ -81,7 +81,5 @@ } ?> -id="= $textId ?>"> - = $this->nl2br($this->markdown($downtime->comment)) ?> -
+ = $this->nl2br($this->markdown($downtime->comment, isset($textId) ? ['id' => $textId] : null)) ?> diff --git a/modules/monitoring/application/views/scripts/partials/event-history.phtml b/modules/monitoring/application/views/scripts/partials/event-history.phtml index 2860a926a..5c34fdc72 100644 --- a/modules/monitoring/application/views/scripts/partials/event-history.phtml +++ b/modules/monitoring/application/views/scripts/partials/event-history.phtml @@ -180,11 +180,9 @@ $rowAction = Url::fromPath('monitoring/event/show'); ) ?> -icon($icon, $iconTitle); - } ?>= $this->nl2br($this->createTicketLinks($this->markdown($msg))) - // TODO(ak): this allows only a[href] in messages, but plugin output allows more - ?>
+ } ?>= $this->nl2br($this->createTicketLinks($this->markdown($msg, ['class' => 'overview-plugin-output']))) ?> diff --git a/modules/monitoring/application/views/scripts/show/components/notes.phtml b/modules/monitoring/application/views/scripts/show/components/notes.phtml index 6011d07f7..87907cfb4 100644 --- a/modules/monitoring/application/views/scripts/show/components/notes.phtml +++ b/modules/monitoring/application/views/scripts/show/components/notes.phtml @@ -38,7 +38,7 @@ if (($navigation->isEmpty() || ! $navigation->hasRenderableItems()) && $notes ==