diff --git a/node_modules/gfm/showdown.js b/node_modules/gfm/showdown.js index 498bb8ed..324b81db 100644 --- a/node_modules/gfm/showdown.js +++ b/node_modules/gfm/showdown.js @@ -68,6 +68,13 @@ // Modifications are tagged with "GFM" // ************************************************** +// ================================================== +// CommonJS modifications by benblank +// http://www.commonjs.org/specs/modules/1.0/ +// +// Modifications are tagged with "CJS" +// ================================================== + // // Showdown namespace // @@ -154,6 +161,12 @@ this.makeHtml = function(text) { // attacklab: Restore tildes text = text.replace(/~T/g,"~"); + // == CJS == Create local `GitHub` object for use by GFM + var GitHub = this.githubRepoName && this.githubRepoOwner ? { + nameWithOwner: this.githubRepoOwner + "/" + this.githubRepoName, + repoName: this.githubRepoName + } : typeof window !== "undefined" ? window.GitHub : undefined; + // ** GFM ** Auto-link URLs and emails text = text.replace(/https?\:\/\/[^"\s\<\>]*[^.,;'">\:\s\<\>\)\]\!]/g, function(wholeMatch,matchIndex){ var left = text.slice(0, matchIndex), right = text.slice(matchIndex) @@ -1359,4 +1372,7 @@ var escapeCharacters_callback = function(wholeMatch,m1) { return "~E"+charCodeToEscape+"E"; } -} // end of Showdown.converter \ No newline at end of file +} // end of Showdown.converter + +// == CJS == Export the converter +if (typeof exports !== "undefined") exports.Converter = Showdown.converter;