Issue #23921: Standardized documentation whitespace formatting.
Original patch by James Edwards.
diff --git a/Doc/library/htmlparser.rst b/Doc/library/htmlparser.rst
index 2af4d0c..e73ce07 100644
--- a/Doc/library/htmlparser.rst
+++ b/Doc/library/htmlparser.rst
@@ -66,8 +66,10 @@
class MyHTMLParser(HTMLParser):
def handle_starttag(self, tag, attrs):
print "Encountered a start tag:", tag
+
def handle_endtag(self, tag):
print "Encountered an end tag :", tag
+
def handle_data(self, data):
print "Encountered some data :", data
@@ -252,21 +254,27 @@
print "Start tag:", tag
for attr in attrs:
print " attr:", attr
+
def handle_endtag(self, tag):
print "End tag :", tag
+
def handle_data(self, data):
print "Data :", data
+
def handle_comment(self, data):
print "Comment :", data
+
def handle_entityref(self, name):
c = unichr(name2codepoint[name])
print "Named ent:", c
+
def handle_charref(self, name):
if name.startswith('x'):
c = unichr(int(name[1:], 16))
else:
c = unichr(int(name))
print "Num ent :", c
+
def handle_decl(self, data):
print "Decl :", data
@@ -298,7 +306,7 @@
attr: ('type', 'text/css')
Data : #python { color: green }
End tag : style
- >>>
+
>>> parser.feed('<script type="text/javascript">'
... 'alert("<strong>hello!</strong>");</script>')
Start tag: script