Skip to content

Commit 900114a

Browse files
committed
move fences to normal
1 parent ef4904d commit 900114a

File tree

1 file changed

+4
-5
lines changed

1 file changed

+4
-5
lines changed

lib/marked.js

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -14,10 +14,9 @@
1414
var block = {
1515
newline: /^\n+/,
1616
code: /^( {4}[^\n]+\n*)+/,
17-
fences: noop,
17+
fences: /^ {0,3}(`{3,}|~{3,})([^`\n]*)\n(?:|([\s\S]*?)\n)(?: {0,3}\1[~`]* *(?:\n+|$)|$)/,
1818
hr: /^ {0,3}((?:- *){3,}|(?:_ *){3,}|(?:\* *){3,})(?:\n+|$)/,
1919
heading: /^ *(#{1,6}) *([^\n]+?) *(?:#+ *)?(?:\n+|$)/,
20-
nptable: noop,
2120
blockquote: /^( {0,3}> ?(paragraph|[^\n]*)(?:\n|$))+/,
2221
list: /^( {0,3})(bull) [\s\S]+?(?:hr|def|\n{2,}(?! )(?!\1bull )\n*|\s*$)/,
2322
html: '^ {0,3}(?:' // optional indentation
@@ -31,6 +30,7 @@ var block = {
3130
+ '|</(?!script|pre|style)[a-z][\\w-]*\\s*>(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:\\n{2,}|$)' // (7) closing tag
3231
+ ')',
3332
def: /^ {0,3}\[(label)\]: *\n? *<?([^\s>]+)>?(?:(?: +\n? *| *\n *)(title))? *(?:\n+|$)/,
33+
nptable: noop,
3434
table: noop,
3535
lheading: /^([^\n]+)\n {0,3}(=|-){2,} *(?:\n+|$)/,
3636
paragraph: /^([^\n]+(?:\n(?!hr|heading|lheading| {0,3}>|<\/?(?:tag)(?: +|\n|\/?>)|<(?:script|pre|style|!--))[^\n]+)*)/,
@@ -91,14 +91,13 @@ block.normal = merge({}, block);
9191
*/
9292

9393
block.gfm = merge({}, block.normal, {
94-
fences: /^ {0,3}(`{3,}|~{3,})([^`\n]*)\n(?:|([\s\S]*?)\n)(?: {0,3}\1[~`]* *(?:\n+|$)|$)/,
9594
paragraph: /^/,
9695
heading: /^ *(#{1,6}) +([^\n]+?) *#* *(?:\n+|$)/
9796
});
9897

9998
block.gfm.paragraph = edit(block.paragraph)
10099
.replace('(?!', '(?!'
101-
+ block.gfm.fences.source.replace('\\1', '\\2') + '|'
100+
+ block.fences.source.replace('\\1', '\\2') + '|'
102101
+ block.list.source.replace('\\1', '\\3') + '|')
103102
.getRegex();
104103

@@ -233,7 +232,7 @@ Lexer.prototype.token = function(src, top) {
233232
continue;
234233
}
235234

236-
// fences (gfm)
235+
// fences
237236
if (cap = this.rules.fences.exec(src)) {
238237
src = src.substring(cap[0].length);
239238
this.tokens.push({

0 commit comments

Comments
 (0)