Skip to content

Instantly share code, notes, and snippets.

@dvas0004
Last active November 22, 2016 11:11
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save dvas0004/a5bc242ea375aed9580559f005224f52 to your computer and use it in GitHub Desktop.
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/
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