summaryrefslogtreecommitdiffstats
path: root/htmlbuffer.py
diff options
context:
space:
mode:
authorJeremy Katz <katzj@redhat.com>2004-03-24 00:35:11 +0000
committerJeremy Katz <katzj@redhat.com>2004-03-24 00:35:11 +0000
commit4357bfca2191ee4a6a3e7b58d72bd807c3822ac0 (patch)
treeb48a9e3db0752373780f9c50c7e1ea2f8340f597 /htmlbuffer.py
parent14a1507a2f8eb825ac68b4602caa3817a6b4606b (diff)
add decimal points to the ordered lists, add spacing for h3 too
Diffstat (limited to 'htmlbuffer.py')
-rw-r--r--htmlbuffer.py6
1 files changed, 4 insertions, 2 deletions
diff --git a/htmlbuffer.py b/htmlbuffer.py
index 4c6cebd5b..4bd996f39 100644
--- a/htmlbuffer.py
+++ b/htmlbuffer.py
@@ -24,7 +24,7 @@ import re
class HTMLBuffer(HTMLParser.HTMLParser):
ignoreTags = ('title',)
noTagTags = ('html', 'head', 'span')
- newlineTags = ('p', 'h1', 'h2')
+ newlineTags = ('p', 'h1', 'h2', 'h3')
entityRefMap = { 'copy': unichr(0xA9),
'lt': '<',
'gt': '>',
@@ -131,7 +131,7 @@ class HTMLBuffer(HTMLParser.HTMLParser):
if not self.inOList:
self.buffer.insert(self.iter, u'\u2022 ')
else:
- self.buffer.insert(self.iter, u'%d ' %(self.inOList,))
+ self.buffer.insert(self.iter, u'%d. ' %(self.inOList,))
self.inOList += 1
elif tag == 'p':
self.startOfP = 1
@@ -160,6 +160,8 @@ class HTMLBuffer(HTMLParser.HTMLParser):
# for the first <li> entry with a <p> following, break
# before the bullet
if self.pInListCounter == 1:
+ if self.inOList:
+ offset -= 2
offset -= 2
# put a newline at the beginning
start = self.buffer.get_iter_at_offset(offset)