mirror of
https://github.com/Hopiu/linkchecker.git
synced 2026-05-04 21:04:41 +00:00
Improve pretty printed comments
This commit is contained in:
parent
607328d5c5
commit
30df69c158
2 changed files with 13 additions and 13 deletions
|
|
@ -87,7 +87,7 @@ class HtmlPrettyPrinter (object):
|
|||
@type data: string
|
||||
@return: None
|
||||
"""
|
||||
self.fd.write("<!--%s-->" % data)
|
||||
self.fd.write("<!-- %s -->" % data)
|
||||
|
||||
def start_element (self, tag, attrs, element_text=None):
|
||||
"""
|
||||
|
|
|
|||
|
|
@ -72,23 +72,23 @@ parsetests = [
|
|||
("""<br/>""", """<br/>"""),
|
||||
("""<a b="50%"><br>""", """<a b="50%"><br/></a>"""),
|
||||
# comments
|
||||
("""<!---->< 1>""", """<!-- -->< 1>"""),
|
||||
("""<!---->< 1>""", """<!-- -->< 1>"""),
|
||||
("""<!-- a - b -->< 2>""", """<!-- a - b -->< 2>"""),
|
||||
("""<!----->< 3>""", """<!----->< 3>"""),
|
||||
("""<!------>< 4>""", """<!------>< 4>"""),
|
||||
("""<!------->< 5>""", """<!------->< 5>"""),
|
||||
("""<!-- -->< 7>""", """<!-- -->< 7>"""),
|
||||
("""<!---- />-->""", """<!---- />-->"""),
|
||||
("""<!----->< 3>""", """<!-- - -->< 3>"""),
|
||||
("""<!------>< 4>""", """<!-- -- -->< 4>"""),
|
||||
("""<!------->< 5>""", """<!-- --- -->< 5>"""),
|
||||
("""<!-- -->< 7>""", """<!-- -->< 7>"""),
|
||||
("""<!---- />-->""", """<!-- -- /> -->"""),
|
||||
("""<!-- a-2 -->< 9>""", """<!-- a-2 -->< 9>"""),
|
||||
("""<!-- --- -->< 10>""", """<!-- --- -->< 10>"""),
|
||||
("""<!>""", """<!-- -->"""), # empty comment
|
||||
("""<!>""", """<!-- -->"""), # empty comment
|
||||
# invalid comments
|
||||
("""<!-- -- >< 8>""", """<!-- -->< 8>"""),
|
||||
("""<!---- >< 6>""", """<!-- -->< 6>"""),
|
||||
("""<!- blubb ->""", """<!--- blubb --->"""),
|
||||
("""<! -- blubb -->""", """<!-- -- blubb ---->"""),
|
||||
("""<!-- -- >< 8>""", """<!-- -->< 8>"""),
|
||||
("""<!---- >< 6>""", """<!-- -->< 6>"""),
|
||||
("""<!- blubb ->""", """<!-- - blubb - -->"""),
|
||||
("""<! -- blubb -->""", """<!-- -- blubb -- -->"""),
|
||||
("""<!-- blubb -- >""", """<!-- blubb -->"""),
|
||||
("""<! blubb !>< a>""", """<!-- blubb !-->< a>"""),
|
||||
("""<! blubb !>< a>""", """<!-- blubb ! -->< a>"""),
|
||||
("""<! blubb >< a>""", """<!-- blubb -->< a>"""),
|
||||
# end tags
|
||||
("""</a>""", """"""),
|
||||
|
|
|
|||
Loading…
Reference in a new issue