Procházet zdrojové kódy

Added AMD friendly piece of code.

Joe Martin před 13 roky
rodič
revize
2d80b3af04
1 změnil soubory, kde provedl 9 přidání a 0 odebrání
  1. 9 0
      src/showdown.js

+ 9 - 0
src/showdown.js

@@ -1339,3 +1339,12 @@ var escapeCharacters_callback = function(wholeMatch,m1) {
 
 // export
 if (typeof module !== 'undefined') module.exports = Showdown;
+
+// stolen from AMD branch of underscore
+// AMD define happens at the end for compatibility with AMD loaders
+// that don't enforce next-turn semantics on modules.
+if (typeof define === 'function' && define.amd) {
+    define('showdown', function() {
+        return Showdown;
+    });
+}