diff --git a/public/app/features/panel/panel_ctrl.ts b/public/app/features/panel/panel_ctrl.ts
index 97d60c960c6..4aee8aad4c4 100644
--- a/public/app/features/panel/panel_ctrl.ts
+++ b/public/app/features/panel/panel_ctrl.ts
@@ -276,7 +276,7 @@ export class PanelCtrl {
let html = '
';
const md = renderMarkdown(interpolatedMarkdown);
- html += config.disableSanitizeHtml ? md : sanitize(md);
+ html += md;
if (panel.links && panel.links.length > 0) {
const interpolatedLinks = getPanelLinksSupplier(panel).getLinks();
@@ -297,7 +297,7 @@ export class PanelCtrl {
html += '
';
- return html;
+ return config.disableSanitizeHtml ? html : sanitize(html);
}
// overriden from react