Skip to content

How to output HTML directly? #4572

Answered by jerch
edu-de asked this question in Q&A
Jun 20, 2023 · 1 comments · 2 replies
Discussion options

You must be logged in to vote

Thats not possible in a direct fashion. The terminal works the other way around - it gives you text/cursor mechanics to be shown by a HTML/JS engine. But to get there, it uses very different render methods depending on the selected renderer (canvas, webgl or DOM), thus it is almost impossible to hook predefined HTML snippets directly into the generated output.

The best you can do here is to parse the content back into a text string as generated by ls and then feed it to the terminal, e.g.

term.write(yourTableParse('<table>...</table>'));

Replies: 1 comment 2 replies

Comment options

You must be logged in to vote
2 replies
@edu-de
Comment options

@jerch
Comment options

Answer selected by Tyriar
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants