For parsing ANSI codes into a custom type. Useful for turning ANSI text into another format such as HTML.
Borrowed from vito/elm-ansi and then modified to fit the rest of this package.
Update a structure with commands parsed out of the given string.
The events relevant to interpreting the stream.
Text is a chunk of text which should be interpreted with the style implied
by the preceding commands (i.e. [SetBold True, Text "foo"]) should yield a
bold fooRemainder is a partial ANSI escape sequence, returned at the end of the
commands if it was cut off. The next string passed to parse should have this
prepended to it.Method to erase the display or line.
Convert an arbitrary String of text into a sequence of commands.
If the input string ends with a partial ANSI escape sequence, it will be yielded as a
Remaindercommand, which should then be prepended to the next call toparse.