Allowed FCB in lists

This commit is contained in:
benweet 2014-05-27 14:33:06 +01:00
parent 3c41c2ec1b
commit c2055098a1

View File

@ -6,18 +6,14 @@ Prism.languages.md = (function() {
var latex = Prism.languages.latex; var latex = Prism.languages.latex;
var lf = /\n/gm;
var md = {}; var md = {};
md['pre gfm'] = { md['pre gfm'] = {
pattern: /^`{3}.*\n(?:[\s\S]*?)\n`{3} *$/gm, pattern: /^`{3}.*\n(?:[\s\S]*?)\n`{3} *$/gm,
inside: { inside: {
"md md-pre": /`{3}/, "md md-pre": /`{3}/,
lf: /\n/gm lf: lf
}
};
md.pre = {
pattern: /(^|(?:^|(?:^|\n)(?![ \t]*([*+\-]|\d+\.)[ \t]).*\n)\s*?\n)(\s*(?: {4}|\t).*(?:\n|$))+/g,
lookbehind: true,
inside: {
} }
}; };
md['h1 alt'] = { md['h1 alt'] = {
@ -30,6 +26,28 @@ Prism.languages.md = (function() {
inside: { inside: {
} }
}; };
for (var i = 6; i >= 1; i--) {
md["h" + i] = {
pattern: new RegExp("^#{" + i + "}.+$", "gm"),
inside: {
"md md-hash": new RegExp("^#{" + i + "} ")
}
};
}
md.li = {
pattern: /^[ \t]*([*+\-]|\d+\.)[ \t].+(?:\n|[ \t].*\n)*/gm,
inside: {
"md md-li": /^[ \t]*([*+\-]|\d+\.)[ \t]/m,
'pre gfm': /^((?: {4}|\t)+)`{3}.*\n(?:[\s\S]*?)\n\1`{3} *$/gm,
lf: lf
}
};
md.pre = {
pattern: /(^|(?:^|(?:^|\n)(?![ \t]*([*+\-]|\d+\.)[ \t]).*\n)\s*?\n)(\s*(?: {4}|\t).*(?:\n|$))+/g,
lookbehind: true,
inside: {
}
};
md.table = { md.table = {
pattern: new RegExp( pattern: new RegExp(
[ [
@ -49,7 +67,7 @@ Prism.languages.md = (function() {
'gm' 'gm'
), ),
inside: { inside: {
lf: /\n/gm lf: lf
} }
}; };
md['table alt'] = { md['table alt'] = {
@ -70,27 +88,13 @@ Prism.languages.md = (function() {
'gm' 'gm'
), ),
inside: { inside: {
lf: /\n/gm lf: lf
} }
}; };
md.hr = { md.hr = {
pattern: /^([*\-_] *){3,}$/gm pattern: /^([*\-_] *){3,}$/gm
}; };
md.li = {
pattern: /^[ \t]*([*+\-]|\d+\.)[ \t].+$/gm,
inside: {
"md md-li": /^[ \t]*([*+\-]|\d+\.)[ \t]/m
}
};
for(var i = 6; i >= 1; i--) {
md["h" + i] = {
pattern: new RegExp("^#{" + i + "}.+$", "gm"),
inside: {
"md md-hash": new RegExp("^#{" + i + "} ")
}
};
}
md.blockquote = { md.blockquote = {
pattern: /^ {0,3}> *[^\n]+$/gm, pattern: /^ {0,3}> *[^\n]+$/gm,
inside: { inside: {
@ -103,7 +107,7 @@ Prism.languages.md = (function() {
inside: { inside: {
"md md-bracket-start": /^(\$\$|\\\\\[|\\\\\\\\\()/, "md md-bracket-start": /^(\$\$|\\\\\[|\\\\\\\\\()/,
"md md-bracket-end": /(\$\$|\\\\\]|\\\\\\\\\))/, "md md-bracket-end": /(\$\$|\\\\\]|\\\\\\\\\))/,
lf: /\n/gm, lf: lf,
rest: latex rest: latex
} }
}; };
@ -111,7 +115,7 @@ Prism.languages.md = (function() {
pattern: /\\?\\begin\{[a-z]*\*?\}[\s\S]*?\\?\\end\{[a-z]*\*?\}/g, pattern: /\\?\\begin\{[a-z]*\*?\}[\s\S]*?\\?\\end\{[a-z]*\*?\}/g,
inside: { inside: {
"keyword": /\\?\\(begin|end)/, "keyword": /\\?\\(begin|end)/,
lf: /\n/gm, lf: lf,
rest: latex rest: latex
} }
}; };