Permalink
Browse files

removed github-flavored-markdown bits. Better linking, seemingly.

  • Loading branch information...
1 parent 082a503 commit e53a2be460c1e18c9231b758680c379705534817 @jashkenas committed May 15, 2010
Showing with 1 addition and 28 deletions.
  1. +1 −28 vendor/showdown.js
View
@@ -61,13 +61,6 @@
//
-// **************************************************
-// GitHub Flavored Markdown modifications by Tekkub
-// http://github.github.com/github-flavored-markdown/
-//
-// Modifications are tagged with "GFM"
-// **************************************************
-
//
// Showdown namespace
//
@@ -154,28 +147,10 @@ this.makeHtml = function(text) {
// attacklab: Restore tildes
text = text.replace(/~T/g,"~");
- // ** GFM ** Auto-link URLs and emails
- text = text.replace(/https?\:\/\/[^"\s\<\>]*[^.,;'">\:\s\<\>\)\]\!]/g, function(wholeMatch){
- var left = RegExp.leftContext
- var right = RegExp.rightContext
- if (left.match(/<[^>]+$/) && right.match(/^[^>]*>/)) {return wholeMatch}
- return "<a href='" + wholeMatch + "'>" + wholeMatch + "</a>";
- });
- text = text.replace(/[a-z0-9_\-+=.]+@[a-z0-9\-]+(\.[a-z0-9-]+)+/ig, function(wholeMatch){return "<a href='mailto:" + wholeMatch + "'>" + wholeMatch + "</a>";});
-
- // ** GFM ** Auto-link user/repo#issue
- text = text.replace(/([a-z0-9_\-+=.]+\/[a-z0-9_\-+=.]+)#([0-9]+)/ig, function(wholeMatch,repo,issue){
- return "<a href='http://github.com/" + repo + "/issues/#issue/" + issue + "'>" + wholeMatch + "</a>";
- });
-
return text;
}
-var _GetRepoName = function() {
- return GitHub.nameWithOwner.match(/^.+\/(.+)$/)[1]
-}
-
var _StripLinkDefinitions = function(text) {
//
// Strips link definitions from text, stores the URLs and titles in
@@ -1006,7 +981,6 @@ var _DoItalicsAndBold = function(text) {
text = text.replace(/(\*\*|__)(?=\S)([^\r]*?\S[*_]*)\1/g,
"<strong>$2</strong>");
- text = text.replace(/(\w)_(\w)/g, "$1~E95E$2") // ** GFM ** "~E95E" == escaped "_"
text = text.replace(/(\*|_)(?=\S)([^\r]*?\S)\1/g,
"<em>$2</em>");
@@ -1088,7 +1062,6 @@ var _FormParagraphs = function(text) {
}
else if (str.search(/\S/) >= 0) {
str = _RunSpanGamut(str);
- // str = str.replace(/\n/g,"<br />"); // ** GFM **
str = str.replace(/^([ \t]*)/g,"<p>");
str += "</p>"
grafsOut.push(str);
@@ -1322,4 +1295,4 @@ var escapeCharacters_callback = function(wholeMatch,m1) {
} // end of Showdown.converter
-exports.Showdown = new Showdown.converter();
+exports.Showdown = new Showdown.converter();

0 comments on commit e53a2be

Please sign in to comment.