Mercurial > libervia-web
diff src/server/html_tools.py @ 1113:cdd389ef97bc
server: code style reformatting using black
author | Goffi <goffi@goffi.org> |
---|---|
date | Fri, 29 Jun 2018 17:45:26 +0200 |
parents | f2170536ba23 |
children |
line wrap: on
line diff
--- a/src/server/html_tools.py Sun Jun 24 22:21:25 2018 +0200 +++ b/src/server/html_tools.py Fri Jun 29 17:45:26 2018 +0200 @@ -20,17 +20,17 @@ def sanitizeHtml(text): """Sanitize HTML by escaping everything""" - #this code comes from official python wiki: http://wiki.python.org/moin/EscapingHtml + # this code comes from official python wiki: http://wiki.python.org/moin/EscapingHtml html_escape_table = { "&": "&", '"': """, "'": "'", ">": ">", "<": "<", - } + } return "".join(html_escape_table.get(c, c) for c in text) def convertNewLinesToXHTML(text): - return text.replace('\n', '<br/>') + return text.replace("\n", "<br/>")