text: import MarkdownItSanitizer from"markdown-it-sanitizer";import MarkdownIt from"markdown-it";var htmlTagRegex=/<html(.|\s)*>(.|\s)*<\/html>/im,md=new MarkdownIt({html:!0,linkify:!0});md.use(MarkdownItSanitizer,{imageClass:"",removeUnbalanced:!1,removeUnknown:!1});var KnockoutMarkdownBinding={register:function(n){n.bindingHandlers.markdown={init:function(){return{controlsDescendantBindings:!0}},update:function(e,r){for(;e.firstChild;)n.removeNode(e.firstChild);var t,a=n.unwrap(r());t=htmlTagRegex.test(a)?a:md.render(a);var o=n.utils.parseHtmlFragment(t,e);e.className=e.className+" markdown";for(var i=0;i<o.length;++i){var d=o[i];setAnchorTargets(d),e.appendChild(d)}}}}};function setAnchorTargets(n){if(n instanceof HTMLAnchorElement&&(n.target="_blank"),n.childNodes&&n.childNodes.length>0)for(var e=0;e<n.childNodes.length;++e)setAnchorTargets(n.childNodes[e])}export default KnockoutMarkdownBinding;