0
votes

I'm building email functionality into an application. Most all email clients mark previous messages in the reply text with a vertical line (perhaps just the "|" character?) along the entire left hand side of the message.

Does anyone know a function/utility (preferably in python), however I can adopt from anything) that would format HTML and text content in this way? It sounds like a pretty easy problem but it's actually quite complex.

1

1 Answers

0
votes

For plain text you can use the textwrap module. Just specify '| ' as the initial_indent and subsequent_indent arguments.

Doing it with HTML requires a different approach, since HTML is normally formatted by the browser. I guess it should be possible using CSS, but I've never done it myself, so I don't know the details.