From 32db2585116254c1c4ca5364be38caceb9aca738 Mon Sep 17 00:00:00 2001 From: Joe Martin Date: Thu, 21 Jun 2012 15:30:33 +0200 Subject: [PATCH] Added AMD friendly piece of code. --- src/showdown.js | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/src/showdown.js b/src/showdown.js index 29306d2..e42b4e5 100644 --- a/src/showdown.js +++ b/src/showdown.js @@ -1442,3 +1442,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; + }); +}