|
@ -1,4 +1,4 @@ |
|
|
/*! markdown-it 8.2.2 https://github.com//markdown-it/markdown-it @license MIT */(function(f){if(typeof exports==="object"&&typeof module!=="undefined"){module.exports=f()}else if(typeof define==="function"&&define.amd){define([],f)}else{var g;if(typeof window!=="undefined"){g=window}else if(typeof global!=="undefined"){g=global}else if(typeof self!=="undefined"){g=self}else{g=this}g.markdownit = f()}})(function(){var define,module,exports;return (function e(t,n,r){function s(o,u){if(!n[o]){if(!t[o]){var a=typeof require=="function"&&require;if(!u&&a)return a(o,!0);if(i)return i(o,!0);var f=new Error("Cannot find module '"+o+"'");throw f.code="MODULE_NOT_FOUND",f}var l=n[o]={exports:{}};t[o][0].call(l.exports,function(e){var n=t[o][1][e];return s(n?n:e)},l,l.exports,e,t,n,r)}return n[o].exports}var i=typeof require=="function"&&require;for(var o=0;o<r.length;o++)s(r[o]);return s})({1:[function(require,module,exports){ |
|
|
/*! markdown-it 8.3.0 https://github.com//markdown-it/markdown-it @license MIT */(function(f){if(typeof exports==="object"&&typeof module!=="undefined"){module.exports=f()}else if(typeof define==="function"&&define.amd){define([],f)}else{var g;if(typeof window!=="undefined"){g=window}else if(typeof global!=="undefined"){g=global}else if(typeof self!=="undefined"){g=self}else{g=this}g.markdownit = f()}})(function(){var define,module,exports;return (function e(t,n,r){function s(o,u){if(!n[o]){if(!t[o]){var a=typeof require=="function"&&require;if(!u&&a)return a(o,!0);if(i)return i(o,!0);var f=new Error("Cannot find module '"+o+"'");throw f.code="MODULE_NOT_FOUND",f}var l=n[o]={exports:{}};t[o][0].call(l.exports,function(e){var n=t[o][1][e];return s(n?n:e)},l,l.exports,e,t,n,r)}return n[o].exports}var i=typeof require=="function"&&require;for(var o=0;o<r.length;o++)s(r[o]);return s})({1:[function(require,module,exports){ |
|
|
// HTML5 entities map: { name -> utf16string }
|
|
|
// HTML5 entities map: { name -> utf16string }
|
|
|
//
|
|
|
//
|
|
|
'use strict'; |
|
|
'use strict'; |
|
@ -1101,6 +1101,10 @@ MarkdownIt.prototype.use = function (plugin /*, params, ... */) { |
|
|
* and then pass updated object to renderer. |
|
|
* and then pass updated object to renderer. |
|
|
**/ |
|
|
**/ |
|
|
MarkdownIt.prototype.parse = function (src, env) { |
|
|
MarkdownIt.prototype.parse = function (src, env) { |
|
|
|
|
|
if (typeof src !== 'string') { |
|
|
|
|
|
throw new Error('Input data should be a String'); |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
var state = new this.core.State(src, this, env); |
|
|
var state = new this.core.State(src, this, env); |
|
|
|
|
|
|
|
|
this.core.process(state); |
|
|
this.core.process(state); |
|
@ -2621,7 +2625,21 @@ module.exports = function blockquote(state, startLine, endLine, silent) { |
|
|
break; |
|
|
break; |
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
|
if (terminate) { break; } |
|
|
|
|
|
|
|
|
if (terminate) { |
|
|
|
|
|
if (oldIndent !== 0) { |
|
|
|
|
|
// state.blkIndent was non-zero, we now set it to zero,
|
|
|
|
|
|
// so we need to re-calculate all offsets to appear as
|
|
|
|
|
|
// if indent wasn't changed
|
|
|
|
|
|
oldBMarks.push(state.bMarks[nextLine]); |
|
|
|
|
|
oldBSCount.push(state.bsCount[nextLine]); |
|
|
|
|
|
oldTShift.push(state.tShift[nextLine]); |
|
|
|
|
|
oldSCount.push(state.sCount[nextLine]); |
|
|
|
|
|
state.sCount[nextLine] -= oldIndent; |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
break; |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
oldBMarks.push(state.bMarks[nextLine]); |
|
|
oldBMarks.push(state.bMarks[nextLine]); |
|
|
oldBSCount.push(state.bsCount[nextLine]); |
|
|
oldBSCount.push(state.bsCount[nextLine]); |
|
@ -3931,13 +3949,16 @@ module.exports = function table(state, startLine, endLine, silent) { |
|
|
var ch, lineText, pos, i, nextLine, columns, columnCount, token, |
|
|
var ch, lineText, pos, i, nextLine, columns, columnCount, token, |
|
|
aligns, t, tableLines, tbodyLines; |
|
|
aligns, t, tableLines, tbodyLines; |
|
|
|
|
|
|
|
|
// should have at least three lines
|
|
|
// should have at least two lines
|
|
|
if (startLine + 2 > endLine) { return false; } |
|
|
if (startLine + 2 > endLine) { return false; } |
|
|
|
|
|
|
|
|
nextLine = startLine + 1; |
|
|
nextLine = startLine + 1; |
|
|
|
|
|
|
|
|
if (state.sCount[nextLine] < state.blkIndent) { return false; } |
|
|
if (state.sCount[nextLine] < state.blkIndent) { return false; } |
|
|
|
|
|
|
|
|
|
|
|
// if it's indented more than 3 spaces, it should be a code block
|
|
|
|
|
|
if (state.sCount[nextLine] - state.blkIndent >= 4) { return false; } |
|
|
|
|
|
|
|
|
// first character of the second line should be '|', '-', ':',
|
|
|
// first character of the second line should be '|', '-', ':',
|
|
|
// and no other characters are allowed but spaces;
|
|
|
// and no other characters are allowed but spaces;
|
|
|
// basically, this is the equivalent of /^[-:|][-:|\s]*$/ regexp
|
|
|
// basically, this is the equivalent of /^[-:|][-:|\s]*$/ regexp
|
|
@ -3984,6 +4005,7 @@ module.exports = function table(state, startLine, endLine, silent) { |
|
|
|
|
|
|
|
|
lineText = getLine(state, startLine).trim(); |
|
|
lineText = getLine(state, startLine).trim(); |
|
|
if (lineText.indexOf('|') === -1) { return false; } |
|
|
if (lineText.indexOf('|') === -1) { return false; } |
|
|
|
|
|
if (state.sCount[startLine] - state.blkIndent >= 4) { return false; } |
|
|
columns = escapedSplit(lineText.replace(/^\||\|$/g, '')); |
|
|
columns = escapedSplit(lineText.replace(/^\||\|$/g, '')); |
|
|
|
|
|
|
|
|
// header row will define an amount of columns in the entire table,
|
|
|
// header row will define an amount of columns in the entire table,
|
|
@ -4026,12 +4048,10 @@ module.exports = function table(state, startLine, endLine, silent) { |
|
|
for (nextLine = startLine + 2; nextLine < endLine; nextLine++) { |
|
|
for (nextLine = startLine + 2; nextLine < endLine; nextLine++) { |
|
|
if (state.sCount[nextLine] < state.blkIndent) { break; } |
|
|
if (state.sCount[nextLine] < state.blkIndent) { break; } |
|
|
|
|
|
|
|
|
lineText = getLine(state, nextLine); |
|
|
lineText = getLine(state, nextLine).trim(); |
|
|
if (lineText.indexOf('|') === -1) { break; } |
|
|
if (lineText.indexOf('|') === -1) { break; } |
|
|
|
|
|
if (state.sCount[nextLine] - state.blkIndent >= 4) { break; } |
|
|
// keep spaces at beginning of line to indicate an empty first cell, but
|
|
|
columns = escapedSplit(lineText.replace(/^\||\|$/g, '')); |
|
|
// strip trailing whitespace
|
|
|
|
|
|
columns = escapedSplit(lineText.replace(/^\||\|\s*$/g, '')); |
|
|
|
|
|
|
|
|
|
|
|
token = state.push('tr_open', 'tr', 1); |
|
|
token = state.push('tr_open', 'tr', 1); |
|
|
for (i = 0; i < columnCount; i++) { |
|
|
for (i = 0; i < columnCount; i++) { |
|
@ -5330,6 +5350,9 @@ module.exports = function link(state, silent) { |
|
|
|
|
|
|
|
|
'use strict'; |
|
|
'use strict'; |
|
|
|
|
|
|
|
|
|
|
|
var isSpace = require('../common/utils').isSpace; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
module.exports = function newline(state, silent) { |
|
|
module.exports = function newline(state, silent) { |
|
|
var pmax, max, pos = state.pos; |
|
|
var pmax, max, pos = state.pos; |
|
|
|
|
|
|
|
@ -5360,13 +5383,13 @@ module.exports = function newline(state, silent) { |
|
|
pos++; |
|
|
pos++; |
|
|
|
|
|
|
|
|
// skip heading spaces for next line
|
|
|
// skip heading spaces for next line
|
|
|
while (pos < max && state.src.charCodeAt(pos) === 0x20) { pos++; } |
|
|
while (pos < max && isSpace(state.src.charCodeAt(pos))) { pos++; } |
|
|
|
|
|
|
|
|
state.pos = pos; |
|
|
state.pos = pos; |
|
|
return true; |
|
|
return true; |
|
|
}; |
|
|
}; |
|
|
|
|
|
|
|
|
},{}],47:[function(require,module,exports){ |
|
|
},{"../common/utils":4}],47:[function(require,module,exports){ |
|
|
// Inline parser state
|
|
|
// Inline parser state
|
|
|
|
|
|
|
|
|
'use strict'; |
|
|
'use strict'; |
|
@ -6201,8 +6224,8 @@ function compile(self) { |
|
|
.map(escapeRE) |
|
|
.map(escapeRE) |
|
|
.join('|'); |
|
|
.join('|'); |
|
|
// (?!_) cause 1.5x slowdown
|
|
|
// (?!_) cause 1.5x slowdown
|
|
|
self.re.schema_test = RegExp('(^|(?!_)(?:[><]|' + re.src_ZPCc + '))(' + slist + ')', 'i'); |
|
|
self.re.schema_test = RegExp('(^|(?!_)(?:[><\uff5c]|' + re.src_ZPCc + '))(' + slist + ')', 'i'); |
|
|
self.re.schema_search = RegExp('(^|(?!_)(?:[><]|' + re.src_ZPCc + '))(' + slist + ')', 'ig'); |
|
|
self.re.schema_search = RegExp('(^|(?!_)(?:[><\uff5c]|' + re.src_ZPCc + '))(' + slist + ')', 'ig'); |
|
|
|
|
|
|
|
|
self.re.pretest = RegExp( |
|
|
self.re.pretest = RegExp( |
|
|
'(' + self.re.schema_test.source + ')|' + |
|
|
'(' + self.re.schema_test.source + ')|' + |
|
@ -6602,10 +6625,14 @@ module.exports = function (opts) { |
|
|
// \p{\Z\Cc} (white spaces + control)
|
|
|
// \p{\Z\Cc} (white spaces + control)
|
|
|
re.src_ZCc = [ re.src_Z, re.src_Cc ].join('|'); |
|
|
re.src_ZCc = [ re.src_Z, re.src_Cc ].join('|'); |
|
|
|
|
|
|
|
|
|
|
|
// Experimental. List of chars, completely prohibited in links
|
|
|
|
|
|
// because can separate it from other part of text
|
|
|
|
|
|
var text_separators = '[><\uff5c]'; |
|
|
|
|
|
|
|
|
// All possible word characters (everything without punctuation, spaces & controls)
|
|
|
// All possible word characters (everything without punctuation, spaces & controls)
|
|
|
// Defined via punctuation & spaces to save space
|
|
|
// Defined via punctuation & spaces to save space
|
|
|
// Should be something like \p{\L\N\S\M} (\w but without `_`)
|
|
|
// Should be something like \p{\L\N\S\M} (\w but without `_`)
|
|
|
re.src_pseudo_letter = '(?:(?!>|<|' + re.src_ZPCc + ')' + re.src_Any + ')'; |
|
|
re.src_pseudo_letter = '(?:(?!' + text_separators + '|' + re.src_ZPCc + ')' + re.src_Any + ')'; |
|
|
// The same as abothe but without [0-9]
|
|
|
// The same as abothe but without [0-9]
|
|
|
// var src_pseudo_letter_non_d = '(?:(?![0-9]|' + src_ZPCc + ')' + src_Any + ')';
|
|
|
// var src_pseudo_letter_non_d = '(?:(?![0-9]|' + src_ZPCc + ')' + src_Any + ')';
|
|
|
|
|
|
|
|
@ -6624,14 +6651,14 @@ module.exports = function (opts) { |
|
|
|
|
|
|
|
|
re.src_host_terminator = |
|
|
re.src_host_terminator = |
|
|
|
|
|
|
|
|
'(?=$|>|<|' + re.src_ZPCc + ')(?!-|_|:\\d|\\.-|\\.(?!$|' + re.src_ZPCc + '))'; |
|
|
'(?=$|' + text_separators + '|' + re.src_ZPCc + ')(?!-|_|:\\d|\\.-|\\.(?!$|' + re.src_ZPCc + '))'; |
|
|
|
|
|
|
|
|
re.src_path = |
|
|
re.src_path = |
|
|
|
|
|
|
|
|
'(?:' + |
|
|
'(?:' + |
|
|
'[/?#]' + |
|
|
'[/?#]' + |
|
|
'(?:' + |
|
|
'(?:' + |
|
|
'(?!' + re.src_ZCc + '|[()[\\]{}.,"\'?!\\-<>]).|' + |
|
|
'(?!' + re.src_ZCc + '|' + text_separators + '|[()[\\]{}.,"\'?!\\-]).|' + |
|
|
'\\[(?:(?!' + re.src_ZCc + '|\\]).)*\\]|' + |
|
|
'\\[(?:(?!' + re.src_ZCc + '|\\]).)*\\]|' + |
|
|
'\\((?:(?!' + re.src_ZCc + '|[)]).)*\\)|' + |
|
|
'\\((?:(?!' + re.src_ZCc + '|[)]).)*\\)|' + |
|
|
'\\{(?:(?!' + re.src_ZCc + '|[}]).)*\\}|' + |
|
|
'\\{(?:(?!' + re.src_ZCc + '|[}]).)*\\}|' + |
|
@ -6741,19 +6768,19 @@ module.exports = function (opts) { |
|
|
|
|
|
|
|
|
re.tpl_email_fuzzy = |
|
|
re.tpl_email_fuzzy = |
|
|
|
|
|
|
|
|
'(^|<|>|\\(|' + re.src_ZCc + ')(' + re.src_email_name + '@' + re.tpl_host_fuzzy_strict + ')'; |
|
|
'(^|' + text_separators + '|\\(|' + re.src_ZCc + ')(' + re.src_email_name + '@' + re.tpl_host_fuzzy_strict + ')'; |
|
|
|
|
|
|
|
|
re.tpl_link_fuzzy = |
|
|
re.tpl_link_fuzzy = |
|
|
// Fuzzy link can't be prepended with .:/\- and non punctuation.
|
|
|
// Fuzzy link can't be prepended with .:/\- and non punctuation.
|
|
|
// but can start with > (markdown blockquote)
|
|
|
// but can start with > (markdown blockquote)
|
|
|
'(^|(?![.:/\\-_@])(?:[$+<=>^`|]|' + re.src_ZPCc + '))' + |
|
|
'(^|(?![.:/\\-_@])(?:[$+<=>^`|\uff5c]|' + re.src_ZPCc + '))' + |
|
|
'((?![$+<=>^`|])' + re.tpl_host_port_fuzzy_strict + re.src_path + ')'; |
|
|
'((?![$+<=>^`|\uff5c])' + re.tpl_host_port_fuzzy_strict + re.src_path + ')'; |
|
|
|
|
|
|
|
|
re.tpl_link_no_ip_fuzzy = |
|
|
re.tpl_link_no_ip_fuzzy = |
|
|
// Fuzzy link can't be prepended with .:/\- and non punctuation.
|
|
|
// Fuzzy link can't be prepended with .:/\- and non punctuation.
|
|
|
// but can start with > (markdown blockquote)
|
|
|
// but can start with > (markdown blockquote)
|
|
|
'(^|(?![.:/\\-_@])(?:[$+<=>^`|]|' + re.src_ZPCc + '))' + |
|
|
'(^|(?![.:/\\-_@])(?:[$+<=>^`|\uff5c]|' + re.src_ZPCc + '))' + |
|
|
'((?![$+<=>^`|])' + re.tpl_host_port_no_ip_fuzzy_strict + re.src_path + ')'; |
|
|
'((?![$+<=>^`|\uff5c])' + re.tpl_host_port_no_ip_fuzzy_strict + re.src_path + ')'; |
|
|
|
|
|
|
|
|
return re; |
|
|
return re; |
|
|
}; |
|
|
}; |
|
|