Allowed FCB in lists

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

View File

@ -1,23 +1,19 @@
// Credit to https://editorially.com/
Prism.languages.md = (function() {
Prism.languages.md = (function () {
var urlPattern = /\b((?:[a-z][\w-]+:(?:\/{1,3}|[a-z0-9%])|www\d{0,3}[.]|[a-z0-9.\-]+[.][a-z]{2,4}\/)(?:[^\s()<>\[\]'"]+|\([^\s()<>\[\]'"]*\))+(?:\([^\s()<>\[\]'"]*\)|[^\s`!()\[\]{}:'".,<>?«»“”‘’]))/gi;
var emailPattern = /[a-z0-9!#$%&'*+\/=?^_`{|}~-]+(?:\.[a-z0-9!#$%&'*+\/=?^_`{|}~-]+)*@(?:[a-z0-9](?:[a-z0-9-]*[a-z0-9])?\.)+(?:[A-Z]{2}|com|org|net|edu|gov|mil|biz|info|mobi|name|aero|asia|jobs|museum)\b/gi;
var latex = Prism.languages.latex;
var lf = /\n/gm;
var md = {};
md['pre gfm'] = {
pattern: /^`{3}.*\n(?:[\s\S]*?)\n`{3} *$/gm,
inside: {
"md md-pre": /`{3}/,
lf: /\n/gm
}
};
md.pre = {
pattern: /(^|(?:^|(?:^|\n)(?![ \t]*([*+\-]|\d+\.)[ \t]).*\n)\s*?\n)(\s*(?: {4}|\t).*(?:\n|$))+/g,
lookbehind: true,
inside: {
lf: lf
}
};
md['h1 alt'] = {
@ -30,6 +26,28 @@ Prism.languages.md = (function() {
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 = {
pattern: new RegExp(
[
@ -49,7 +67,7 @@ Prism.languages.md = (function() {
'gm'
),
inside: {
lf: /\n/gm
lf: lf
}
};
md['table alt'] = {
@ -70,27 +88,13 @@ Prism.languages.md = (function() {
'gm'
),
inside: {
lf: /\n/gm
lf: lf
}
};
md.hr = {
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 = {
pattern: /^ {0,3}> *[^\n]+$/gm,
inside: {
@ -103,7 +107,7 @@ Prism.languages.md = (function() {
inside: {
"md md-bracket-start": /^(\$\$|\\\\\[|\\\\\\\\\()/,
"md md-bracket-end": /(\$\$|\\\\\]|\\\\\\\\\))/,
lf: /\n/gm,
lf: lf,
rest: latex
}
};
@ -111,7 +115,7 @@ Prism.languages.md = (function() {
pattern: /\\?\\begin\{[a-z]*\*?\}[\s\S]*?\\?\\end\{[a-z]*\*?\}/g,
inside: {
"keyword": /\\?\\(begin|end)/,
lf: /\n/gm,
lf: lf,
rest: latex
}
};
@ -295,7 +299,7 @@ Prism.languages.md = (function() {
tag: Prism.languages.markup.tag,
entity: Prism.languages.markup.entity
};
for(var c = 6; c >= 1; c--) {
for (var c = 6; c >= 1; c--) {
md["h" + c].inside.rest = rest;
}
md["h1 alt"].inside.rest = rest;