-
Notifications
You must be signed in to change notification settings - Fork 1.6k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Extensions "DEPRECATION WARNING" but no documentation #224
Comments
You're absolutely right. I will update the documentation as soon as possible. |
Just an FYI here - I would also really appreciate some info about what's changing and how to use it! 😁 |
My fault. I've updated the wiki to reflect the new extension loading mechanism. Regardless, I'm also posting here some boilerplate code for extensions, with conditional loading and showdown's new proper loading mechanism, for quick reference. (function (extension) {
if (typeof showdown !== 'undefined') {
// global (browser or nodejs global)
extension(showdown);
} else if (typeof define === 'function' && define.amd) {
// AMD
define(['showdown'], extension);
} else if (typeof exports === 'object') {
// Node, CommonJS-like
module.exports = extension(require('showdown'));
} else {
// showdown was not found so we throw
throw Error('Could not find showdown library');
}
}(function (showdown) {
// loading extension into shodown
showdown.extension('myext', function () {
var myext = { /* ... actual extension code ... */ };
return [myext];
});
})); |
I just realized that I'm getting
DEPRECATION WARNING: some_extension is an old extension that uses a deprecated loading method.Please inform the developer that the extension should be updated!
with my extensions, but there is no documentation how to make it in "new way".The text was updated successfully, but these errors were encountered: