diff --git a/abschnitte/utils.py b/abschnitte/utils.py index 6194727..6d13cf4 100644 --- a/abschnitte/utils.py +++ b/abschnitte/utils.py @@ -3,6 +3,10 @@ import base64 import zlib import re from textwrap import dedent +from django.conf import settings + +# Import the caching function +from diagramm_proxy.diagram_cache import get_cached_diagram DIAGRAMMSERVER="/diagramm" @@ -25,15 +29,23 @@ def render_textabschnitte(queryset): elif typ == "tabelle": html = md_table_to_html(inhalt) elif typ == "diagramm": - temp=inhalt.splitlines() - diagramtype=temp.pop(0) - diagramoptions='width="100%"' - if temp[0][0:6].lower() == "option": - diagramoptions=temp.pop(0).split(":",1)[1] - rest="\n".join(temp) - html = '
Error generating diagram: {str(e)}
' + elif typ == "code": html = ""
html += markdown(inhalt, extensions=['tables', 'attr_list'])