Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit aa76344

Browse files
committed
change blank line insertion at a few places and fix recursion bug for </var>
1 parent 150316e commit aa76344

1 file changed

Lines changed: 8 additions & 8 deletions

File tree

Lib/htmllib.py

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -227,7 +227,7 @@ def start_blockquote(self, attrs):
227227
self.formatter.push_margin('blockquote')
228228

229229
def end_blockquote(self):
230-
self.formatter.end_paragraph(0)
230+
self.formatter.end_paragraph(1)
231231
self.formatter.pop_margin()
232232

233233
# --- List Elements
@@ -279,11 +279,11 @@ def end_dir(self):
279279
self.end_ul()
280280

281281
def start_dl(self, attrs):
282-
self.formatter.end_paragraph(0)
282+
self.formatter.end_paragraph(1)
283283
self.list_stack.append(['dl', '', 0])
284284

285285
def end_dl(self):
286-
self.ddpop()
286+
self.ddpop(1)
287287
if self.list_stack: del self.list_stack[-1]
288288

289289
def do_dt(self, attrs):
@@ -294,8 +294,8 @@ def do_dd(self, attrs):
294294
self.formatter.push_margin('dd')
295295
self.list_stack.append(['dd', '', 0])
296296

297-
def ddpop(self):
298-
self.formatter.end_paragraph(0)
297+
def ddpop(self, bl=0):
298+
self.formatter.end_paragraph(bl)
299299
if self.list_stack:
300300
if self.list_stack[-1][0] == 'dd':
301301
del self.list_stack[-1]
@@ -320,11 +320,11 @@ def end_kbd(self): self.end_tt()
320320
def start_samp(self, attrs): self.start_tt(attrs)
321321
def end_samp(self): self.end_tt()
322322

323-
def start_string(self, attrs): self.start_b(attrs)
324-
def end_b(self): self.end_b()
323+
def start_strong(self, attrs): self.start_b(attrs)
324+
def end_strong(self): self.end_b()
325325

326326
def start_var(self, attrs): self.start_i(attrs)
327-
def end_var(self): self.end_var()
327+
def end_var(self): self.end_i()
328328

329329
# Typographic Elements
330330

0 commit comments

Comments
 (0)