sparksuite / simplemde-markdown-editor

A simple, beautiful, and embeddable JavaScript Markdown editor. Delightful editing for beginners and experts alike. Features built-in autosaving and spell checking.
https://simplemde.com
MIT License
9.79k stars 1.12k forks source link

FontAwesome provide non-CDN url #791

Open Ruud-cb opened 4 years ago

Ruud-cb commented 4 years ago

Hi,

We are using this great library inside an application that is running internally on-premise without internet connectivity. The application on it's turn is also a standardised CMS, so modifications in terms of inserting FontAwesome on the index.html is not really..appreciated. If at least we want to stick to the latest version and not create our own version.

We are working on a PR to include the CMS's dependencies locally instead of loading them via CDN. Thus we also did it for simplemde. Now we see that simplemde also uses a cdn inside their code base.

Looking at the documentation, the first parameter autoDownloadFontAwesome

autoDownloadFontAwesome: If set to true, force downloads Font Awesome (used for icons). If set to false, prevents downloading. Defaults to undefined, which will intelligently check whether Font Awesome has already been included, then download accordingly.

Looking at the code, it's not so "intelligently" as I hoped: https://github.com/sparksuite/simplemde-markdown-editor/blob/6abda7ab68cc20f4aca870eb243747951b90ab04/src/js/simplemde.js#L1276

It simply enforces to load via CDN anyway if it's not in the index.html (or loaded in another way).

Feature request: