From: Daniel Lenski Date: Wed, 3 Nov 2021 20:57:10 +0000 (-0700) Subject: Avoid code duplication in www/html.py X-Git-Tag: v8.20~49 X-Git-Url: https://www.infradead.org/git/?a=commitdiff_plain;h=7ff45d968d4efa491a5c751d8c2ab8ea0541311d;p=users%2Fdwmw2%2Fopenconnect.git Avoid code duplication in www/html.py Ping #342, closes !279. Signed-off-by: Dimitri Papadopoulos <3350651-DimitriPapadopoulos@users.noreply.gitlab.com> Signed-off-by: Daniel Lenski --- diff --git a/www/html.py b/www/html.py index 0facd819..9278e016 100755 --- a/www/html.py +++ b/www/html.py @@ -120,21 +120,13 @@ class docHandler(xml.sax.ContentHandler): idx = len(replace) replace[idx:] = [repl] - elif name == "br": - writeHtml(" 0: - names = attrs.getNames() - for name in names: - writeHtml(" " + name + "=\"" + attrs.get(name) + "\"") - writeHtml(" />") - else: writeHtml("<" + name) if attrs.getLength() > 0: names = attrs.getNames() for name in names: writeHtml(" " + name + "=\"" + attrs.get(name) + "\"") - writeHtml(">") + writeHtml(" />" if name == "br" else ">") def characters(self, ch): self.content += ch