From 0397f8d2d63b50a3669284dee4a203eb045b72b1 Mon Sep 17 00:00:00 2001 From: Dendy Faist Date: Sat, 24 Feb 2024 11:23:18 +0100 Subject: [PATCH] fix: Error on entering a document that doesn't exist --- static/style/main.css | 4 ++++ templates/main.html | 10 +++++++--- 2 files changed, 11 insertions(+), 3 deletions(-) diff --git a/static/style/main.css b/static/style/main.css index 2980c1d..f0c8ccd 100644 --- a/static/style/main.css +++ b/static/style/main.css @@ -70,6 +70,10 @@ pre { padding-left: 20px; } +.grayed { + color: gray; +} + .editor-toolbar { border-top: 0px solid #444; diff --git a/templates/main.html b/templates/main.html index 0bc4fe1..cff0fe2 100644 --- a/templates/main.html +++ b/templates/main.html @@ -26,9 +26,13 @@ Edit {% endif %} - {% autoescape false %} - {{ markdown(content, extensions=['extra']) }} - {% endautoescape %} + {% if content is not none %} + {% autoescape false %} + {{ markdown(content, extensions=['extra']) }} + {% endautoescape %} + {% else %} +

This document doesn't exist

+ {% endif %} {% else %}