57 Public method to prettify HTML tags. |
54 Public method to prettify HTML tags. |
58 |
55 |
59 @param tag tag to be prettified (string) |
56 @param tag tag to be prettified (string) |
60 @return prettified tag (string) |
57 @return prettified tag (string) |
61 """ |
58 """ |
62 result = re.sub(" {{1,{0}}}".format(self.__indentWidth), " ", tag, |
59 return re.sub(" {{1,{0}}}".format(self.__indentWidth), " ", tag, |
63 flags=re.MULTILINE) |
60 flags=re.MULTILINE) |
64 return result |
|
65 |
61 |
66 def commentPrettify(self, matchobj): |
62 def commentPrettify(self, matchobj): |
67 """ |
63 """ |
68 Public method to prettify HTML comments. |
64 Public method to prettify HTML comments. |
69 |
65 |
70 @param matchobj reference to the match object (re.MatchObject) |
66 @param matchobj reference to the match object (re.MatchObject) |
71 @return prettified comment (string) |
67 @return prettified comment (string) |
72 """ |
68 """ |
73 if re.search("\n", matchobj.group()): |
69 if re.search("\n", matchobj.group()): |
74 result = self.tagPrettify(matchobj.group()) |
70 return self.tagPrettify(matchobj.group()) |
75 else: |
71 else: |
76 result = matchobj.group() |
72 return matchobj.group() |
77 return result |
|