Mercurial > libervia-web
diff libervia/server/html_tools.py @ 1509:106bae41f5c8
massive refactoring from camelCase -> snake_case. See backend commit log for more details
author | Goffi <goffi@goffi.org> |
---|---|
date | Sat, 08 Apr 2023 13:44:11 +0200 |
parents | 822bd0139769 |
children |
line wrap: on
line diff
--- a/libervia/server/html_tools.py Fri Apr 07 15:20:40 2023 +0200 +++ b/libervia/server/html_tools.py Sat Apr 08 13:44:11 2023 +0200 @@ -18,7 +18,7 @@ # along with this program. If not, see <http://www.gnu.org/licenses/>. -def sanitizeHtml(text): +def sanitize_html(text): """Sanitize HTML by escaping everything""" # this code comes from official python wiki: http://wiki.python.org/moin/EscapingHtml html_escape_table = { @@ -32,5 +32,5 @@ return "".join(html_escape_table.get(c, c) for c in text) -def convertNewLinesToXHTML(text): +def convert_new_lines_to_xhtml(text): return text.replace("\n", "<br/>")