diff --git a/modules/extras.py b/modules/extras.py index a6fc9f497..b4434bea3 100644 --- a/modules/extras.py +++ b/modules/extras.py @@ -37,7 +37,7 @@ def run_pnginfo(image): if parser.settings is None: info += f"{plaintext_to_html(str(parser.parameters))}" else: - info += f"
" + info += "
" first = True for setting in parser.settings: if first: @@ -45,14 +45,12 @@ def run_pnginfo(image): else: info += ", " info += pnginfo_format_setting(str(setting[0]), str(setting[1])+str(setting[2])) - info += f"
" - + info += "" + if parser.extra is not None: info += f"{plaintext_to_html(str(parser.extra))}" - info += f""" -\n -""" + info += "\n" else: items = {**{'parameters': geninfo}, **items} diff --git a/modules/png_parser.py b/modules/png_parser.py index f06576fb5..f6066fc43 100644 --- a/modules/png_parser.py +++ b/modules/png_parser.py @@ -13,11 +13,10 @@ class PngParser: def parse_pnginfo(self, pnginfo_string): try: # separate positive, negative, and parameters - tlen = len(pnginfo_string) m = PngParser.re_top_level.search(pnginfo_string) if m is None: return False - + self.positive = m.group(1) self.negative = m.group(2) self.parameters = m.group(3) @@ -35,9 +34,9 @@ class PngParser: self.settings = PngParser.re_parameters.findall(self.parameters) if self.settings is None: return False - except: + except Exception: return False - + return True @classmethod diff --git a/script.js b/script.js index b0e1b9c28..c554e9115 100644 --- a/script.js +++ b/script.js @@ -214,7 +214,7 @@ function uiElementInSight(el) { } function uiCopyElementText(el) { - text = el.innerText + var text = el.innerText if (text.startsWith('"')) { text = text.substring(1, text.length-1).replace('\\n', '\n') }