Merge branch 'remy-master'

This commit is contained in:
Corey Innis 2010-10-31 11:10:54 -07:00
commit 4405b2639e
4 changed files with 21 additions and 1309 deletions

1
.gitignore vendored Normal file
View File

@ -0,0 +1 @@
.DS_Store

View File

@ -1,9 +1,9 @@
/*
A A L Source code at:
T C A <http://www.attacklab.net/>
T K B
*/
/*
A A L Source code at:
T C A <http://www.attacklab.net/>
T K B
*/
var Showdown={};
Showdown.converter=function(){
var _1;
@ -416,4 +416,4 @@ var _b6=m1.charCodeAt(0);
return "~E"+_b6+"E";
};
};
if(typeof exports!='undefined')exports.Showdown=Showdown;

File diff suppressed because it is too large Load Diff

1
example/showdown.js Symbolic link
View File

@ -0,0 +1 @@
../src/showdown.js

View File

@ -3,8 +3,8 @@
//
// Copyright (c) 2007 John Fraser.
//
// Original Markdown Copyright (c) 2004-2005 John Gruber
// <http://daringfireball.net/projects/markdown/>
// Original Markdown Copyright (c) 2004-2005 John Gruber
// <http://daringfireball.net/projects/markdown/>
//
// Redistributable under a BSD-style open source license.
// See license.txt for more information.
@ -661,10 +661,10 @@ var _DoHeaders = function(text) {
// --------
//
text = text.replace(/^(.+)[ \t]*\n=+[ \t]*\n+/gm,
function(wholeMatch,m1){return hashBlock("<h1>" + _RunSpanGamut(m1) + "</h1>");});
function(wholeMatch,m1){return hashBlock('<h1 id="' + headerId(m1) + '">' + _RunSpanGamut(m1) + "</h1>");});
text = text.replace(/^(.+)[ \t]*\n-+[ \t]*\n+/gm,
function(matchFound,m1){return hashBlock("<h2>" + _RunSpanGamut(m1) + "</h2>");});
function(matchFound,m1){return hashBlock('<h2 id="' + headerId(m1) + '">' + _RunSpanGamut(m1) + "</h2>");});
// atx-style headers:
// # Header 1
@ -688,9 +688,12 @@ var _DoHeaders = function(text) {
text = text.replace(/^(\#{1,6})[ \t]*(.+?)[ \t]*\#*\n+/gm,
function(wholeMatch,m1,m2) {
var h_level = m1.length;
return hashBlock("<h" + h_level + ">" + _RunSpanGamut(m2) + "</h" + h_level + ">");
return hashBlock("<h" + h_level + ' id="' + headerId(m2) + '">' + _RunSpanGamut(m2) + "</h" + h_level + ">");
});
function headerId(m) {
return m.replace(/[^\w]/g, '').toLowerCase();
}
return text;
}
@ -1293,4 +1296,7 @@ var escapeCharacters_callback = function(wholeMatch,m1) {
return "~E"+charCodeToEscape+"E";
}
} // end of Showdown.converter
} // end of Showdown.converter
// export
if (typeof exports != 'undefined') exports.Showdown = Showdown;