mattboldt / typed.js

A JavaScript Typing Animation Library

Home Page:http://www.mattboldt.com/demos/typed-js/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

`preStringTyped` is not called if string begins with HTML tag

steponas opened this issue · comments

Description

preStringTyped is not called when the strings start with HTML tags.

Demo

Demo with counts (expected and actual): https://jsfiddle.net/s8rdLnmt/

Additional Information

This occurs because the HTML tags are "skipped" when rendering but the curIndex is increased, and the "start index" of the render string is > 0. Yet https://github.com/mattboldt/typed.js/blob/main/src/typed.js#L200 expects the index to be 0 to call preStringTyped - thus it does not work.