Load js and css sources in UTF-8 (#7059)

This commit is contained in:
LawnMauer 2025-06-11 03:16:50 +02:00 committed by GitHub
parent 4cf39120fc
commit bc921c66e5
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 15 additions and 14 deletions

View file

@ -39,15 +39,16 @@ def minify_css(css: str) -> str:
return css
with open(Path(__file__).resolve().parent / '../css/html_readable_style.css', 'r') as f:
with open(Path(__file__).resolve().parent / '../css/html_readable_style.css', 'r', encoding='utf-8') as f:
readable_css = f.read()
with open(Path(__file__).resolve().parent / '../css/html_instruct_style.css', 'r') as f:
with open(Path(__file__).resolve().parent / '../css/html_instruct_style.css', 'r', encoding='utf-8') as f:
instruct_css = f.read()
# Custom chat styles
chat_styles = {}
for k in get_available_chat_styles():
chat_styles[k] = open(Path(f'css/chat_style-{k}.css'), 'r').read()
with open(Path(f'css/chat_style-{k}.css'), 'r', encoding='utf-8') as f:
chat_styles[k] = f.read()
# Handle styles that derive from other styles
for k in chat_styles: