Kaydet (Commit) aa763447 authored tarafından Guido van Rossum's avatar Guido van Rossum

change blank line insertion at a few places and fix recursion bug for </var>

üst 150316ee
...@@ -227,7 +227,7 @@ class HTMLParser(SGMLParser): ...@@ -227,7 +227,7 @@ class HTMLParser(SGMLParser):
self.formatter.push_margin('blockquote') self.formatter.push_margin('blockquote')
def end_blockquote(self): def end_blockquote(self):
self.formatter.end_paragraph(0) self.formatter.end_paragraph(1)
self.formatter.pop_margin() self.formatter.pop_margin()
# --- List Elements # --- List Elements
...@@ -279,11 +279,11 @@ class HTMLParser(SGMLParser): ...@@ -279,11 +279,11 @@ class HTMLParser(SGMLParser):
self.end_ul() self.end_ul()
def start_dl(self, attrs): def start_dl(self, attrs):
self.formatter.end_paragraph(0) self.formatter.end_paragraph(1)
self.list_stack.append(['dl', '', 0]) self.list_stack.append(['dl', '', 0])
def end_dl(self): def end_dl(self):
self.ddpop() self.ddpop(1)
if self.list_stack: del self.list_stack[-1] if self.list_stack: del self.list_stack[-1]
def do_dt(self, attrs): def do_dt(self, attrs):
...@@ -294,8 +294,8 @@ class HTMLParser(SGMLParser): ...@@ -294,8 +294,8 @@ class HTMLParser(SGMLParser):
self.formatter.push_margin('dd') self.formatter.push_margin('dd')
self.list_stack.append(['dd', '', 0]) self.list_stack.append(['dd', '', 0])
def ddpop(self): def ddpop(self, bl=0):
self.formatter.end_paragraph(0) self.formatter.end_paragraph(bl)
if self.list_stack: if self.list_stack:
if self.list_stack[-1][0] == 'dd': if self.list_stack[-1][0] == 'dd':
del self.list_stack[-1] del self.list_stack[-1]
...@@ -320,11 +320,11 @@ class HTMLParser(SGMLParser): ...@@ -320,11 +320,11 @@ class HTMLParser(SGMLParser):
def start_samp(self, attrs): self.start_tt(attrs) def start_samp(self, attrs): self.start_tt(attrs)
def end_samp(self): self.end_tt() def end_samp(self): self.end_tt()
def start_string(self, attrs): self.start_b(attrs) def start_strong(self, attrs): self.start_b(attrs)
def end_b(self): self.end_b() def end_strong(self): self.end_b()
def start_var(self, attrs): self.start_i(attrs) def start_var(self, attrs): self.start_i(attrs)
def end_var(self): self.end_var() def end_var(self): self.end_i()
# Typographic Elements # Typographic Elements
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment