This extension came about because it's important functionality that was too large to include in the core Feather Wiki code. It requires an extra library that was too large to justify adding in, but it's the perfect opportunity to demonstrate how to override default Feather Wiki behavior!
Installation #
To use the HTML to Markdown extension, you can do one of the following things:
- Go to your Wiki Settings and add
to the "Custom Head" text area.<script src="https://feather.wiki/extensions/v1.8.x/html-to-md.js"></script>
- Save the HTML to Markdown extension file to the same folder as your Feather Wiki file and add
to the "Custom Head" text area in Wiki Settings.<script src="./html-to-md.js"></script>
- (This way requires that the
html-to-md.js
file always remains in the same folder as your wiki file.)
- (This way requires that the
- Go to the source code for the extension, copy the code, and paste the whole script directly into the "Custom JS" text area in Wiki Settings.
What it Does #
Once you add your extension code, you will not be able to see the results until you save your wiki and re-load the file. When it's saved and reloaded, the HTML to Markdown extension will change the behavior of the "Use Markdown" button on versions of Feather Wiki that allow you to switch between editors: instead of putting the HTML directly into the Markdown field, it will use Turndown to try to convert the HTML into Markdown.
Note: This extension requires a connection to the internet because it loads Turndown from an external CDN. It is possible to modify the code to use a local version, but you will need to download the turndown.js
code and modify the extension yourself for that.
Previous Versions #
Starting with Version 1.8.0, extensions are now stored in paths that include the minor version number (i.e. extensions for version 1.8.0 are stored in extensions/v1.8.x/
) to indicate that they are incompatible with lower version numbers. The version of this extension compatible with versions of Feather Wiki below 1.8.0 can still be found at https://feather.wiki/extensions/html-to-md.js
, but the old version will no longer receive updates.