From 8b4662c027c10c3ee11000a413ee44e2ed844ea2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tom=20Tr=C3=B6ger?= Date: Thu, 25 Sep 2025 21:43:14 +0200 Subject: [PATCH] few styling changes + now ignoring lines with colon at the end --- src/functions.py | 2 ++ src/static/style.css | 24 ++++++++++++++++++++---- src/templates/index.html | 31 +++++++++++++++---------------- 3 files changed, 37 insertions(+), 20 deletions(-) diff --git a/src/functions.py b/src/functions.py index fdb2929..673fd12 100755 --- a/src/functions.py +++ b/src/functions.py @@ -52,6 +52,8 @@ def convert_text(text: str, format_indents:bool=True): return "\n".join(changed_lines).strip() def match_and_replace(line:str, format_indents:bool=True) -> str: + if re.search(":$", line) != None: + return line if format_indents: line, num = re.subn("(\t+.)(..*)", rf"\1 {{{{c1::\2}}}}", line) if num > 0: diff --git a/src/static/style.css b/src/static/style.css index 087dd99..19665fc 100755 --- a/src/static/style.css +++ b/src/static/style.css @@ -40,28 +40,44 @@ h1 { margin-bottom: 0.5rem; } -textarea { +#left { grid-area: input; } -pre { +#right { grid-area: output; } -main > div { +#copy-btn { + align-self: flex-start; +} + +main > div, +main > form { width: 100%; box-sizing: border-box; + display: flex; + flex-direction: column; + gap: 0.5rem; } textarea { width: 100%; - height: 20vh; + height: 100%; margin: 20px 0; -webkit-box-sizing: border-box; -moz-box-sizing: border-box; box-sizing: border-box; } +pre { + white-space: pre-wrap; /* Since CSS 2.1 */ + white-space: -moz-pre-wrap; /* Mozilla, since 1999 */ + white-space: -pre-wrap; /* Opera 4-6 */ + white-space: -o-pre-wrap; /* Opera 7 */ + word-wrap: break-word; /* Internet Explorer 5.5+ */ +} + input[type="file"] { display: none; } diff --git a/src/templates/index.html b/src/templates/index.html index acfc7ce..da234a4 100755 --- a/src/templates/index.html +++ b/src/templates/index.html @@ -7,27 +7,26 @@

Upload File/Enter Text

-
-
-
- - -
- - -
+ +
+ + +
+ +
-
- - -
+
+
+ + {% if resp_text %}

Converted Text