mirror of
https://github.com/showdownjs/showdown.git
synced 2024-03-22 13:30:55 +08:00
Fixed #20 -- Github style codeblocks can now start the parsed string
This commit is contained in:
parent
b48c06fe72
commit
9a0492a7ac
|
@ -888,7 +888,7 @@ var _DoCodeBlocks = function(text) {
|
||||||
text = text.replace(/~0/,"");
|
text = text.replace(/~0/,"");
|
||||||
|
|
||||||
return text;
|
return text;
|
||||||
}
|
};
|
||||||
|
|
||||||
var _DoGithubCodeBlocks = function(text) {
|
var _DoGithubCodeBlocks = function(text) {
|
||||||
//
|
//
|
||||||
|
@ -905,7 +905,7 @@ var _DoGithubCodeBlocks = function(text) {
|
||||||
// attacklab: sentinel workarounds for lack of \A and \Z, safari\khtml bug
|
// attacklab: sentinel workarounds for lack of \A and \Z, safari\khtml bug
|
||||||
text += "~0";
|
text += "~0";
|
||||||
|
|
||||||
text = text.replace(/\n```(.*)\n([^`]+)\n```/g,
|
text = text.replace(/(?:^|\n)```(.*)\n([^`]+)\n```/g,
|
||||||
function(wholeMatch,m1,m2) {
|
function(wholeMatch,m1,m2) {
|
||||||
var language = m1;
|
var language = m1;
|
||||||
var codeblock = m2;
|
var codeblock = m2;
|
||||||
|
|
Loading…
Reference in New Issue
Block a user