fix: Error on entering a document that doesn't exist

This commit is contained in:
Dendy 2024-02-24 11:23:18 +01:00
parent 99911d025a
commit 0397f8d2d6
2 changed files with 11 additions and 3 deletions

View File

@ -70,6 +70,10 @@ pre {
padding-left: 20px;
}
.grayed {
color: gray;
}
.editor-toolbar {
border-top: 0px solid #444;

View File

@ -26,9 +26,13 @@
<a href="/{{ path }}?edit">Edit</a>
{% endif %}
{% autoescape false %}
{{ markdown(content, extensions=['extra']) }}
{% endautoescape %}
{% if content is not none %}
{% autoescape false %}
{{ markdown(content, extensions=['extra']) }}
{% endautoescape %}
{% else %}
<p class="grayed">This document doesn't exist</p>
{% endif %}
{% else %}
<form method="POST" action="/{{ path }}">
<textarea id="markdown-textarea" name="text">{{ content }}</textarea>