I thought it was useful to have a component that can parse some simple HTML and format it like a common browser does, and most importantly mixing hyperlinks with normal text. So I made this class that attempts to make some basic parsing without using Regular Expressions, just parses the HTML byte by byte in a single step, adds the resulting setFont()
, setColour()
and insertTextAtCaret()
to the TextEditor, and stores all links into an Array
.
File attached. Suggestions for new optimizations are very welcome.
HtmlTextEdit.h (11.1 KB)
EDIT: find improved versions below…
EDIT 2: Full project on GitHub: