Last active
November 22, 2016 11:11
-
-
Save dvas0004/a5bc242ea375aed9580559f005224f52 to your computer and use it in GitHub Desktop.
Modified kibana markdown vizualization - allow unsanitized HTML (be careful.....) http://blog.davidvassallo.me/2016/11/22/embedding-javascript-and-html-into-kibana-5-x/
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import marked from 'marked'; | |
import uiModules from 'ui/modules'; | |
import 'angular-sanitize'; | |
marked.setOptions({ | |
gfm: true, // Github-flavored markdown | |
sanitize: true // Sanitize HTML tags | |
}); | |
const module = uiModules.get('kibana/markdown_vis', ['kibana']); | |
module.controller('KbnMarkdownVisController', function ($scope, $sce) { | |
$scope.$watch('vis.params.markdown', function (html) { | |
if (!html) return; | |
$scope.html = $sce.trustAsHtml(html); | |
}); | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment