mirror of
https://github.com/showdownjs/showdown.git
synced 2024-03-22 13:30:55 +08:00
Fix CommonJS support
module.exports is not part of CommonJS and only few CommonJS platforms support it exports is the standard way to export a module API changing the reference of the exports object is also not standard and not always supported A related fix has also been recently provided on the Mustache.js project
This commit is contained in:
parent
2e102c72b2
commit
6b87d38733
|
@ -64,7 +64,9 @@
|
||||||
//
|
//
|
||||||
// Showdown namespace
|
// Showdown namespace
|
||||||
//
|
//
|
||||||
var Showdown = { extensions: {} };
|
var Showdown = typeof exports === 'object' ? exports : {};
|
||||||
|
|
||||||
|
Showdown.extensions = {};
|
||||||
|
|
||||||
//
|
//
|
||||||
// forEach
|
// forEach
|
||||||
|
@ -1441,9 +1443,6 @@ var escapeCharacters_callback = function(wholeMatch,m1) {
|
||||||
} // end of Showdown.converter
|
} // end of Showdown.converter
|
||||||
|
|
||||||
|
|
||||||
// export
|
|
||||||
if (typeof module !== 'undefined') module.exports = Showdown;
|
|
||||||
|
|
||||||
// stolen from AMD branch of underscore
|
// stolen from AMD branch of underscore
|
||||||
// AMD define happens at the end for compatibility with AMD loaders
|
// AMD define happens at the end for compatibility with AMD loaders
|
||||||
// that don't enforce next-turn semantics on modules.
|
// that don't enforce next-turn semantics on modules.
|
||||||
|
|
Loading…
Reference in New Issue
Block a user