mirror of
https://github.com/showdownjs/showdown.git
synced 2024-03-22 13:30:55 +08:00
Merge branch 'remy-master'
This commit is contained in:
commit
4405b2639e
1
.gitignore
vendored
Normal file
1
.gitignore
vendored
Normal file
|
@ -0,0 +1 @@
|
|||
.DS_Store
|
|
@ -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;
|
1296
example/showdown.js
1296
example/showdown.js
File diff suppressed because it is too large
Load Diff
1
example/showdown.js
Symbolic link
1
example/showdown.js
Symbolic link
|
@ -0,0 +1 @@
|
|||
../src/showdown.js
|
|
@ -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;
|
Loading…
Reference in New Issue
Block a user