gouthambs/Flask-Blogging

Preview Not Working

jawatson opened this issue · 2 comments

I recently forked the project in order to make a few minor tweaks to improve the formatting when used with Bootstrap 4. However, I found that the Preview button on the edit page wasn't working when building the current code. This issue suggested that this could be casued by not including a markdown parser library.

The extrajs block at the bottom of the editor.html template doesn't call up a markdown parser but does appear to reference both the standard and minified version of bootstrap-markdown library. Modifying the extrajs block at the bottom of templates/blogging/editor.html to replace the redundant call to the bootstrap-markdown lib with a call to the marked lib fixes this for me and the preview button works as expected;

{% block extrajs %}
    <script type="text/javascript"
        src="https://cdnjs.cloudflare.com/ajax/libs/marked/0.5.1/marked.min.js">
    </script>
    <script type="text/javascript"
        src="https://cdnjs.cloudflare.com/ajax/libs/bootstrap-markdown/2.10.0/js/bootstrap-markdown.min.js">
    </script>
 {% endblock extrajs %}

Can you give a PR please?

Unfortunately, my copy of editor.html now has a number of other (small) changes to improve the layout when using Bootstrap 4 so can't be pulled into the main branch without messing up your layout.