wdpr
    Preparing search index...
    • Render an array of tokens to HTML with hl-* class spans.

      This is a faithful port of Text_Highlighter's HTML renderer:

      • Adjacent tokens with the same class are merged into a single <span>.
      • All text is wrapped in spans (no unwrapped text nodes).
      • The output is wrapped in <div class="hl-main"><pre>...</pre></div>.

      Parameters

      • tokens: Token[]

        Array of tokens produced by tokenize.

      Returns string

      Complete HTML string for the highlighted code block.