Member Junction
    Preparing search index...
    • Creates a marked extension that renders SVG code blocks as actual SVG images.

      When encountering a code block with language "svg", this extension will render it as an actual SVG element instead of showing the code.

      This is useful for:

      • UX mockups and wireframes
      • Diagrams and illustrations
      • Icons and simple graphics
      • Any visual content that can be expressed as SVG

      Usage in markdown:

      
        
      
      

      The generated HTML structure:

      <div class="svg-rendered">
      <svg ...>...</svg>
      </div>

      The tokenizer is framework-agnostic — it emits an svgCodeBlock token whose svgContent can be rendered to HTML (web) or to a native SVG component (React Native via react-native-svg). The HTML renderer below is only used by the web/HTML output path.

      Security note: SVG content is rendered as-is. Make sure to only render trusted SVG content or sanitize it on the target platform when rendering user-provided content.

      Returns MarkedExtension