TagSoup - v3.1.0
    Preparing search index...

    Function createTokenizer

    • Reads tokens from text and returns them by invoking a callback.

      Tokens are guaranteed to be returned in correct order. Missing tokens are inserted to restore the correct order if needed.

      Parameters

      Returns Tokenizer

      import { createTokenizer, htmlTokenizerOptions } from 'tag-soup';

      const tokenizer = createTokenizer(htmlTokenizerOptions);

      tokenizer.tokenize(
      'Hello, <b>Bob</b>!',
      (token, startIndex, endIndex) => {
      // Handle token here
      },
      );