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; padding-left: 20px;
} }
.grayed {
color: gray;
}
.editor-toolbar { .editor-toolbar {
border-top: 0px solid #444; border-top: 0px solid #444;

View File

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