|
|
|
|
|
by jaytaylor
1370 days ago
|
|
Years ago I made a Go library called `html2text' just for this: https://github.com/jaytaylor/html2text/ https://jaytaylor.com/html2text It takes HTML as input and generates markdown-esque plaintext, with the main focus being to make the plaintext version easy and pleasant to read for human beings. Then using MIME types*, you transmit both the rich html version alongside the generated text/plain version. This is cool because it makes it easy to respect both rich clients (like Gmail et. al.) as well as command-line or other clients which work better with simple text. Hope this helps folks have the best of both worlds! :) cheers * n.b. To ensure this works properly, be sure to use the right MIME headers: https://stackoverflow.com/questions/3902455/mail-multipart-a... |
|
Now whatever the receiver decides they want to view they can.