This might need to be something that refactors the whole terminal screen system, an AST-like structure would be ideal for translating directly into HTML and would likely be more memory-efficient for most programs. The only issue is I would have to set up an indexing system for the AST, and someway of starting new attributes, though I'm sure I can figure that out, maybe a recursive function? However that probably wouldn't work too well for streaming items in.
This might need to be something that refactors the whole terminal screen system, an AST-like structure would be ideal for translating directly into HTML and would likely be more memory-efficient for most programs. The only issue is I would have to set up an indexing system for the AST, and someway of starting new attributes, though I'm sure I can figure that out, maybe a recursive function? However that probably wouldn't work too well for streaming items in.