diff --git a/generate_errors.py b/generate_errors.py index d189f7d..a6101e8 100644 --- a/generate_errors.py +++ b/generate_errors.py @@ -34,8 +34,11 @@ for item in codes: code, title, desc = item.groups() if int(code) < 400 or int(code) >= 600: continue with error.joinpath(f'{code}.html').open('w') as html: - html.write(root_html.format( - code=code, title=title, desc=desc, style=root_css)) + content = root_html.format( + code=code, title=title, desc=desc, style=root_css) + content = re.sub(r'\s+', ' ', content) + content = re.sub(r'>\s<', '><', content) + html.write(content) nginx_head += f'error_page {code} @error{code};\n' nginx_body += f'location @error{code} {{\n'\ f'root {error.resolve()};\n'\