Shows untrusted SVG markup in host: it is run through sanitize first (required; use
MarkdownService.SanitizeHtml in Angular hosts), then mounted interactively when it carries the MJ Diagram
contract (data-mj-diagram="1"), or shown as a static SVG otherwise. Returns the viewer, or null when the
markup is not an MJ diagram.
Sanitizing keeps <style>, so the SVG is placed in a shadow root, where its CSS cannot select anything on the
page, and host gets paint containment, so position: fixed or :host rules cannot draw outside it.
Shows untrusted SVG markup in
host: it is run throughsanitizefirst (required; useMarkdownService.SanitizeHtmlin Angular hosts), then mounted interactively when it carries the MJ Diagram contract (data-mj-diagram="1"), or shown as a static SVG otherwise. Returns the viewer, or null when the markup is not an MJ diagram.Sanitizing keeps
<style>, so the SVG is placed in a shadow root, where its CSS cannot select anything on the page, andhostgets paint containment, soposition: fixedor:hostrules cannot draw outside it.