|
@ -2542,15 +2542,14 @@ module.exports = { |
|
|
module.exports = { |
|
|
module.exports = { |
|
|
singleQuotes: '‘’', |
|
|
singleQuotes: '‘’', |
|
|
doubleQuotes: '“”', // «» - russian, „“ - deutch
|
|
|
doubleQuotes: '“”', // «» - russian, „“ - deutch
|
|
|
copyright: true, |
|
|
copyright: true, // (c) (C) → ©
|
|
|
trademark: true, |
|
|
trademark: true, // (tm) (TM) → ™
|
|
|
registered: true, |
|
|
registered: true, // (r) (R) → ®
|
|
|
plusminus: true, |
|
|
plusminus: true, // +- → ±
|
|
|
paragraph: true, |
|
|
paragraph: true, // (p) (P) → §
|
|
|
ellipsis: true, |
|
|
ellipsis: true, // ... → …
|
|
|
dupes: true, |
|
|
dupes: true, // ???????? → ???, !!!!! → !!!, `,,` → `,`
|
|
|
emDashes: true, |
|
|
emDashes: true // -- → —
|
|
|
linkify: true |
|
|
|
|
|
}; |
|
|
}; |
|
|
|
|
|
|
|
|
},{}],10:[function(require,module,exports){ |
|
|
},{}],10:[function(require,module,exports){ |
|
@ -2806,6 +2805,11 @@ function parseLinkLabel(state, start) { |
|
|
|
|
|
|
|
|
if (state.validateInsideLink) { return -1; } |
|
|
if (state.validateInsideLink) { return -1; } |
|
|
|
|
|
|
|
|
|
|
|
if (state.label_nest_level) { |
|
|
|
|
|
state.label_nest_level--; |
|
|
|
|
|
return -1; |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
state.pos = start + 1; |
|
|
state.pos = start + 1; |
|
|
state.validateInsideLink = true; |
|
|
state.validateInsideLink = true; |
|
|
level = 1; |
|
|
level = 1; |
|
@ -2827,7 +2831,12 @@ function parseLinkLabel(state, start) { |
|
|
if (!ok) { state.pending += state.src[state.pos++]; } |
|
|
if (!ok) { state.pending += state.src[state.pos++]; } |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
if (found) { labelEnd = state.pos; } |
|
|
if (found) { |
|
|
|
|
|
labelEnd = state.pos; |
|
|
|
|
|
state.label_nest_level = 0; |
|
|
|
|
|
} else { |
|
|
|
|
|
state.label_nest_level = level - 1; |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
// restore old state
|
|
|
// restore old state
|
|
|
state.pos = oldPos; |
|
|
state.pos = oldPos; |
|
@ -5557,6 +5566,9 @@ function links(state) { |
|
|
// Link reference
|
|
|
// Link reference
|
|
|
//
|
|
|
//
|
|
|
|
|
|
|
|
|
|
|
|
// do not allow nested reference links
|
|
|
|
|
|
if (state.linkLevel > 0) { return false; } |
|
|
|
|
|
|
|
|
// [foo] [bar]
|
|
|
// [foo] [bar]
|
|
|
// ^^ optional whitespace (can include newlines)
|
|
|
// ^^ optional whitespace (can include newlines)
|
|
|
for (; pos < max; pos++) { |
|
|
for (; pos < max; pos++) { |
|
@ -5609,7 +5621,9 @@ function links(state) { |
|
|
title: title, |
|
|
title: title, |
|
|
level: state.level++ |
|
|
level: state.level++ |
|
|
}); |
|
|
}); |
|
|
|
|
|
state.linkLevel++; |
|
|
state.parser.tokenize(state); |
|
|
state.parser.tokenize(state); |
|
|
|
|
|
state.linkLevel--; |
|
|
state.push({ type: 'link_close', level: --state.level }); |
|
|
state.push({ type: 'link_close', level: --state.level }); |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
@ -5683,9 +5697,11 @@ function StateInline(src, parser, options, env) { |
|
|
this.posMax = this.src.length; |
|
|
this.posMax = this.src.length; |
|
|
this.validateInsideEm = false; |
|
|
this.validateInsideEm = false; |
|
|
this.validateInsideLink = false; |
|
|
this.validateInsideLink = false; |
|
|
|
|
|
this.linkLevel = 0; |
|
|
this.level = 0; |
|
|
this.level = 0; |
|
|
this.link_content = ''; |
|
|
this.link_content = ''; |
|
|
this.pendingLevel = 0; |
|
|
this.pendingLevel = 0; |
|
|
|
|
|
this.label_nest_level = 0; // for stmd-like backtrack optimization
|
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|