gouthambs / Flask-Blogging

A Markdown Based Python Blog Engine as a Flask Extension.
http://flask-blogging.readthedocs.org/en/latest/
MIT License
690 stars 160 forks source link

Preview Not Working #121

Closed jawatson closed 5 years ago

jawatson commented 5 years ago

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 %}
gouthambs commented 5 years ago

Can you give a PR please?

jawatson commented 5 years ago

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.