Browse Source

demo update

pull/14/head
Vitaly Puzrin 10 years ago
parent
commit
013c8ecc7d
  1. 4
      demo/index.html
  2. 36
      dist/remarkable.js
  3. 4
      dist/remarkable.min.js

4
demo/index.html

@ -103,6 +103,10 @@ test.. test... test..... test?..... test!....
Remarkable -- awesome Remarkable -- awesome
"Smartypants, double quotes"
'Smartypants, single quotes'
## Emphasis ## Emphasis

36
dist/remarkable.js

@ -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
} }

4
dist/remarkable.min.js

File diff suppressed because one or more lines are too long
Loading…
Cancel
Save