few styling changes + now ignoring lines with colon at the end
All checks were successful
Publish Docker image / Push Docker image to Docker Hub (push) Successful in -2s

This commit is contained in:
2025-09-25 21:43:14 +02:00
parent b03faed2fb
commit 8b4662c027
3 changed files with 37 additions and 20 deletions

View File

@@ -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:

View File

@@ -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;
}

View File

@@ -7,27 +7,26 @@
<body>
<main>
<h1 class="input">Upload File/Enter Text</h1>
<div id="left">
<form action="/upload" method="post" enctype="multipart/form-data" class="">
<div class="form_button">
<label class="custom-file-upload">
<input id="myfile" type="file" name="file" accept=".pdf" />
<span>Custom Upload</span>
</label>
<button type="submit">Convert</button>
<div class="checkbox-wrapper-14">
<input id="s1-14" type="checkbox" class="switch" {% if format_indents %}checked {% endif %} name="format_indents" />
<label for="s1-14">Stichpunkte formatieren</label>
</div>
<form id="left" action="/upload" method="post" enctype="multipart/form-data" class="">
<div class="form_button">
<label class="custom-file-upload">
<input id="myfile" type="file" name="file" accept=".pdf" />
<span>Custom Upload</span>
</label>
<button type="submit">Convert</button>
<div class="checkbox-wrapper-14">
<input id="s1-14" type="checkbox" class="switch" {% if format_indents %}checked {% endif %} name="format_indents" />
<label for="s1-14">Stichpunkte formatieren</label>
</div>
<br />
<textarea name="text">{% if resp_text %}{{ base_text }}{% else %}Text in here{% endif %}</textarea>
</form>
</div>
</div>
<br />
<textarea name="text">{% if resp_text %}{{ base_text }}{% else %}Text in here{% endif %}</textarea>
</form>
{% if resp_text %}
<h1 class="output">Converted Text</h1>
<div id="right">
<button id="copy-btn">Copy Text</button>
<br />
<pre id="myInput">
{{ resp_text }}
</pre