flask-simplemde icon indicating copy to clipboard operation
flask-simplemde copied to clipboard

Font awesome & flask-simplemde compatibility

Open ghost opened this issue 5 years ago • 1 comments

Hi,

I try to add some icons from FontAwesome in my Flask project, it's working, great. The problem is I use too flask-simplemde in this project. Both are not friends.

I think simple-mde retrieve icons from FontAwesome and some are not showing up..

Screenshot 2020-06-01 at 16 14 48

This is happening only when I add the <script> tag for FontAwesome in my template file.

Thank you for help !

ghost avatar Jun 01 '20 14:06 ghost

I tried to modify the __init__.py file of flask-simplemde according to official SimpleMDE documentation like this :

JS_LOAD_WITH_ID = """<script>
var simplemde = new SimpleMDE({ 
    autoDownloadFontAwesome: undefined,
    element: document.getElementById("%s")
    });
</script>
"""

JS_LOAD_WITH_ID_IIFE = """<script>
(function () {
    var simplemde = new SimpleMDE({ 
        autoDownloadFontAwesome: undefined,
        element: document.getElementById("%s")
        });
})();
</script>
"""

It's only supposed to download font awesome if it's not already there. It's not working for this option but for another it works like the toolbar: false which hides the toolbar.

I don't understand why autoDownloadFontAwesome option isn't working 🤔

ghost avatar Jun 01 '20 16:06 ghost