aaronsw / html2text

Convert HTML to Markdown-formatted text.
http://www.aaronsw.com/2002/html2text/
GNU General Public License v3.0
2.61k stars 412 forks source link

Add teletype (tt) tag to those that are converted to inline code. #30

Closed stephenmcd closed 12 years ago

stephenmcd commented 12 years ago

The teletype tag is used to represent text with a fixed-width font. This change adds it to the tags that are converted to inline code.

stephenmcd commented 12 years ago

I've also moved the __main__ code into a main() function that can be referenced as an entrypoint script. This means when installed, you can just run the command "html2text" system-wide. Sorry about not using separate branches.

stephenmcd commented 12 years ago

My use-case is piping unicode output from another program into html2text, however there's currently no way to provide an encoding when read from stdin. I've made utf-8 the default encoding.

aaronsw commented 12 years ago

Seems reasonable. Did you run the automated tests?

stephenmcd commented 12 years ago

Yep they all pass. What do you think about the encoding change for reading stdin? My first thought was to rearrange the options to make encoding a named option so that you could specify the encoding type when reading stdin, but that would mean changing the existing api.

aaronsw commented 12 years ago

Having utf8 as the default sounds right to me.

stephenmcd commented 12 years ago

Alright then. Thanks for the merge :-)