From c5e74bd22c8a964b2f29f25f8add5315bb714dec Mon Sep 17 00:00:00 2001 From: Mylloon Date: Fri, 22 Dec 2023 15:37:19 +0100 Subject: [PATCH] fix: newlines --- src/routes/read.py | 2 +- src/templates/read.html | 5 +++-- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/src/routes/read.py b/src/routes/read.py index d56eeb6..4d67c89 100644 --- a/src/routes/read.py +++ b/src/routes/read.py @@ -21,7 +21,7 @@ def read(file: int) -> str: read_page=True, page_name=name, name=f"{file}.txt", - file=post.content if post else None, + file=post.content.split("\n") if post else None, post_file_id=post_file_id, date=post.creation_date if post else None, ) diff --git a/src/templates/read.html b/src/templates/read.html index a20e696..0451a1d 100644 --- a/src/templates/read.html +++ b/src/templates/read.html @@ -10,8 +10,9 @@ {% if file %}

{{ name }}

-

{{ file }}

- {% else %} + {% for para in file %} +

{{para}}

+ {% endfor %} {% else %}

{{ name }} doesn't exists

{% endif %}