From 4357bfca2191ee4a6a3e7b58d72bd807c3822ac0 Mon Sep 17 00:00:00 2001 From: Jeremy Katz Date: Wed, 24 Mar 2004 00:35:11 +0000 Subject: add decimal points to the ordered lists, add spacing for h3 too --- htmlbuffer.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'htmlbuffer.py') 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
  • entry with a

    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) -- cgit