I'm not sure I understand a use case for lossless reverse HTML import. TeXmacs can import HTML (e.g. Wikipedia pages) including proper recovery of mathematical formulas from MathJaX or MathML. TeXmacs can export HTML with math in MathML (since 2005), MathJaX or images according to user preferences. The exported HTML human-readable (although with some CSS here and there) like the LaTeX export (who say the contrary has visibly never used TeXmacs, at least recently). You can check the quality of the HTML export by looking at TeXmacs website (
https://www.texmacs.org/tmweb/home/welcome.en.html) and at the blog (
https://texmacs.github.io/notes/docs/main.html) or also at this other blog (
https://plopezadeva.com) or at the webpage of Joris van der Hoeven, the main developer (
http://www.texmacs.org/joris/main/joris.html). Comments and suggestions for improvements are welcome. TeXmacs do not use UTF-8 (or any other Unicode encoding) internally but support an arbitrary, extensible encoding (much like Unicode) which can be converted to Unicode without problems. The reason is simple: TeXmacs was initiated before Unicode was widely supported (~1998). Even in current times we see few reason to move to Unicode, all the TeXmacs internals are independent from external libraries or tools. It was properly working in ~1999, it works now and it will work as long as a minimal C++ compiler works.