mwg API
    Preparing search index...

    Function sliceSpans

    • The first count visible characters across already-parsed spans, styles kept - the progressive-reveal slice for RichLabel, where markers must never count toward the total nor leak onto screen half-shown. Counts in string characters, the same unit String.slice (and MessageBox's own reveal) uses.

      Parameters

      Returns MarkdownSpan[]

      import { parseMarkdown, sliceSpans } from '@datamoc/mw_games/two-d/ui';

      sliceSpans(parseMarkdown('Take **two** coins'), 7);
      // [{ text: 'Take ', bold: false, italic: false },
      // { text: 'tw', bold: true, italic: false }]