Skip to content

Commit

Permalink
Merge pull request #56 from fmarier/preformatted_in_lists
Browse files Browse the repository at this point in the history
Preformatted text in lists needs extra indentation
  • Loading branch information
aaronsw committed Nov 5, 2012
2 parents 08a889b + e87c968 commit 1d57ff1
Show file tree
Hide file tree
Showing 3 changed files with 19 additions and 0 deletions.
2 changes: 2 additions & 0 deletions html2text.py
Expand Up @@ -600,6 +600,8 @@ def o(self, data, puredata=0, force=0):

if self.pre:
bq += " "
for i in xrange(len(self.list)):
bq += " "
data = data.replace("\n", "\n"+bq)

if self.start:
Expand Down
10 changes: 10 additions & 0 deletions test/preformatted_in_list.html
@@ -0,0 +1,10 @@
<html>
<body>
<ul>
<li>Run this command:
<pre>ls -l *.html</pre></li>
<li>?</li>
<li>Profit!</li>
</ul>
</body>
</html>
7 changes: 7 additions & 0 deletions test/preformatted_in_list.md
@@ -0,0 +1,7 @@
* Run this command:

ls -l *.html

* ?
* Profit!

0 comments on commit 1d57ff1

Please sign in to comment.