--- a/ProjectWeb/Html5Prettifier.py Tue May 25 19:44:14 2021 +0200 +++ b/ProjectWeb/Html5Prettifier.py Tue May 25 20:12:47 2021 +0200 @@ -9,7 +9,7 @@ import re -from PyQt5.QtCore import QObject +from PyQt6.QtCore import QObject import Preferences @@ -22,8 +22,10 @@ """ Constructor - @param html HTML text to be prettified (string) - @param parent reference to the parent object (QObject) + @param html HTML text to be prettified + @type str + @param parent reference to the parent object + @type QObject """ super().__init__(parent) @@ -34,7 +36,8 @@ """ Public method to prettify the HTML code. - @return prettified HTML code (string) + @return prettified HTML code + @rtype str """ from bs4 import BeautifulSoup soup = BeautifulSoup(self.__html, "html.parser") @@ -53,8 +56,10 @@ """ Public method to prettify HTML tags. - @param tag tag to be prettified (string) - @return prettified tag (string) + @param tag tag to be prettified + @type str + @return prettified tag + @rtype str """ return re.sub(" {{1,{0}}}".format(self.__indentWidth), " ", tag, flags=re.MULTILINE) @@ -63,8 +68,10 @@ """ Public method to prettify HTML comments. - @param matchobj reference to the match object (re.MatchObject) - @return prettified comment (string) + @param matchobj reference to the match object + @type re.MatchObject + @return prettified comment + @rtype str """ if re.search("\n", matchobj.group()): return self.tagPrettify(matchobj.group())