@subiz/widget-v4 4.1.26 → 4.1.28
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/compiled_src/chatbox/Header.js +12 -7
- package/compiled_src/chatbox/Widget.js +12 -0
- package/compiled_src/chatbox/main.js +24 -2
- package/compiled_src/util/campaign.js +17 -8
- package/dist/132.js +52 -11
- package/dist/18754d60df1.132.js +1 -0
- package/dist/18754d60df1.441.js +1 -0
- package/dist/18754d60df1.app.js +1 -0
- package/dist/{186bfd5b9ef.index.html → 18754d60df1.index.html} +9 -2
- package/dist/{186bfd5b9ef.library.html → 18754d60df1.library.html} +9 -2
- package/dist/18754d60df1.library.js +1 -0
- package/dist/{186bfd5b9ef.preview.html → 18754d60df1.preview.html} +1 -1
- package/dist/18754d60df1.preview.js +1 -0
- package/dist/18754d60df1.screenshoot.js +1 -0
- package/dist/18754d60df1.webview.js +1 -0
- package/dist/441.js +216 -152
- package/dist/HASH +1 -1
- package/dist/screenshoot.html +1 -1
- package/dist/screenshoot.js +43 -15
- package/index.html +8 -0
- package/package.json +10 -10
- package/src/chatbox/Header.js +12 -9
- package/src/chatbox/Widget.js +14 -0
- package/src/chatbox/main.js +24 -1
- package/src/util/campaign.js +29 -8
- package/dist/186bfd5b9ef.132.js +0 -1
- package/dist/186bfd5b9ef.441.js +0 -1
- package/dist/186bfd5b9ef.app.js +0 -1
- package/dist/186bfd5b9ef.library.js +0 -1
- package/dist/186bfd5b9ef.preview.js +0 -1
- package/dist/186bfd5b9ef.screenshoot.js +0 -1
- package/dist/186bfd5b9ef.webview.js +0 -1
- /package/dist/{186bfd5b9ef.178.js → 18754d60df1.178.js} +0 -0
- /package/dist/{186bfd5b9ef.213.js → 18754d60df1.213.js} +0 -0
- /package/dist/{186bfd5b9ef.335.js → 18754d60df1.335.js} +0 -0
- /package/dist/{186bfd5b9ef.362.js → 18754d60df1.362.js} +0 -0
- /package/dist/{186bfd5b9ef.605.js → 18754d60df1.605.js} +0 -0
- /package/dist/{186bfd5b9ef.678.js → 18754d60df1.678.js} +0 -0
- /package/dist/{186bfd5b9ef.782.js → 18754d60df1.782.js} +0 -0
package/dist/441.js
CHANGED
|
@@ -6,6 +6,7 @@
|
|
|
6
6
|
|
|
7
7
|
__webpack_require__.r(__webpack_exports__);
|
|
8
8
|
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
|
|
9
|
+
/* harmony export */ "Hooks": () => (/* binding */ Hooks),
|
|
9
10
|
/* harmony export */ "Lexer": () => (/* binding */ Lexer),
|
|
10
11
|
/* harmony export */ "Parser": () => (/* binding */ Parser),
|
|
11
12
|
/* harmony export */ "Renderer": () => (/* binding */ Renderer),
|
|
@@ -25,7 +26,7 @@ __webpack_require__.r(__webpack_exports__);
|
|
|
25
26
|
/* harmony export */ "walkTokens": () => (/* binding */ walkTokens)
|
|
26
27
|
/* harmony export */ });
|
|
27
28
|
/**
|
|
28
|
-
* marked v4.
|
|
29
|
+
* marked v4.3.0 - a markdown parser
|
|
29
30
|
* Copyright (c) 2011-2023, Christopher Jeffrey. (MIT Licensed)
|
|
30
31
|
* https://github.com/markedjs/marked
|
|
31
32
|
*/
|
|
@@ -45,6 +46,7 @@ function getDefaults() {
|
|
|
45
46
|
headerIds: true,
|
|
46
47
|
headerPrefix: '',
|
|
47
48
|
highlight: null,
|
|
49
|
+
hooks: null,
|
|
48
50
|
langPrefix: 'language-',
|
|
49
51
|
mangle: true,
|
|
50
52
|
pedantic: false,
|
|
@@ -209,23 +211,6 @@ function resolveUrl(base, href) {
|
|
|
209
211
|
|
|
210
212
|
const noopTest = { exec: function noopTest() {} };
|
|
211
213
|
|
|
212
|
-
function merge(obj) {
|
|
213
|
-
let i = 1,
|
|
214
|
-
target,
|
|
215
|
-
key;
|
|
216
|
-
|
|
217
|
-
for (; i < arguments.length; i++) {
|
|
218
|
-
target = arguments[i];
|
|
219
|
-
for (key in target) {
|
|
220
|
-
if (Object.prototype.hasOwnProperty.call(target, key)) {
|
|
221
|
-
obj[key] = target[key];
|
|
222
|
-
}
|
|
223
|
-
}
|
|
224
|
-
}
|
|
225
|
-
|
|
226
|
-
return obj;
|
|
227
|
-
}
|
|
228
|
-
|
|
229
214
|
function splitCells(tableRow, count) {
|
|
230
215
|
// ensure that every cell-delimiting pipe has a space
|
|
231
216
|
// before it to distinguish it from an escaped pipe
|
|
@@ -1135,7 +1120,7 @@ class Tokenizer {
|
|
|
1135
1120
|
const block = {
|
|
1136
1121
|
newline: /^(?: *(?:\n|$))+/,
|
|
1137
1122
|
code: /^( {4}[^\n]+(?:\n(?: *(?:\n|$))*)?)+/,
|
|
1138
|
-
fences: /^ {0,3}(`{3,}(?=[^`\n]
|
|
1123
|
+
fences: /^ {0,3}(`{3,}(?=[^`\n]*(?:\n|$))|~{3,})([^\n]*)(?:\n|$)(?:|([\s\S]*?)(?:\n|$))(?: {0,3}\1[~`]* *(?=\n|$)|$)/,
|
|
1139
1124
|
hr: /^ {0,3}((?:-[\t ]*){3,}|(?:_[ \t]*){3,}|(?:\*[ \t]*){3,})(?:\n+|$)/,
|
|
1140
1125
|
heading: /^ {0,3}(#{1,6})(?=\s|$)(.*)(?:\n+|$)/,
|
|
1141
1126
|
blockquote: /^( {0,3}> ?(paragraph|[^\n]*)(?:\n|$))+/,
|
|
@@ -1210,17 +1195,18 @@ block.blockquote = edit(block.blockquote)
|
|
|
1210
1195
|
* Normal Block Grammar
|
|
1211
1196
|
*/
|
|
1212
1197
|
|
|
1213
|
-
block.normal =
|
|
1198
|
+
block.normal = { ...block };
|
|
1214
1199
|
|
|
1215
1200
|
/**
|
|
1216
1201
|
* GFM Block Grammar
|
|
1217
1202
|
*/
|
|
1218
1203
|
|
|
1219
|
-
block.gfm =
|
|
1204
|
+
block.gfm = {
|
|
1205
|
+
...block.normal,
|
|
1220
1206
|
table: '^ *([^\\n ].*\\|.*)\\n' // Header
|
|
1221
1207
|
+ ' {0,3}(?:\\| *)?(:?-+:? *(?:\\| *:?-+:? *)*)(?:\\| *)?' // Align
|
|
1222
1208
|
+ '(?:\\n((?:(?! *\\n|hr|heading|blockquote|code|fences|list|html).*(?:\\n|$))*)\\n*|$)' // Cells
|
|
1223
|
-
}
|
|
1209
|
+
};
|
|
1224
1210
|
|
|
1225
1211
|
block.gfm.table = edit(block.gfm.table)
|
|
1226
1212
|
.replace('hr', block.hr)
|
|
@@ -1248,7 +1234,8 @@ block.gfm.paragraph = edit(block._paragraph)
|
|
|
1248
1234
|
* Pedantic grammar (original John Gruber's loose markdown specification)
|
|
1249
1235
|
*/
|
|
1250
1236
|
|
|
1251
|
-
block.pedantic =
|
|
1237
|
+
block.pedantic = {
|
|
1238
|
+
...block.normal,
|
|
1252
1239
|
html: edit(
|
|
1253
1240
|
'^ *(?:comment *(?:\\n|\\s*$)'
|
|
1254
1241
|
+ '|<(tag)[\\s\\S]+?</\\1> *(?:\\n{2,}|\\s*$)' // closed tag
|
|
@@ -1272,7 +1259,7 @@ block.pedantic = merge({}, block.normal, {
|
|
|
1272
1259
|
.replace('|list', '')
|
|
1273
1260
|
.replace('|html', '')
|
|
1274
1261
|
.getRegex()
|
|
1275
|
-
}
|
|
1262
|
+
};
|
|
1276
1263
|
|
|
1277
1264
|
/**
|
|
1278
1265
|
* Inline-Level Grammar
|
|
@@ -1374,13 +1361,14 @@ inline.reflinkSearch = edit(inline.reflinkSearch, 'g')
|
|
|
1374
1361
|
* Normal Inline Grammar
|
|
1375
1362
|
*/
|
|
1376
1363
|
|
|
1377
|
-
inline.normal =
|
|
1364
|
+
inline.normal = { ...inline };
|
|
1378
1365
|
|
|
1379
1366
|
/**
|
|
1380
1367
|
* Pedantic Inline Grammar
|
|
1381
1368
|
*/
|
|
1382
1369
|
|
|
1383
|
-
inline.pedantic =
|
|
1370
|
+
inline.pedantic = {
|
|
1371
|
+
...inline.normal,
|
|
1384
1372
|
strong: {
|
|
1385
1373
|
start: /^__|\*\*/,
|
|
1386
1374
|
middle: /^__(?=\S)([\s\S]*?\S)__(?!_)|^\*\*(?=\S)([\s\S]*?\S)\*\*(?!\*)/,
|
|
@@ -1399,20 +1387,21 @@ inline.pedantic = merge({}, inline.normal, {
|
|
|
1399
1387
|
reflink: edit(/^!?\[(label)\]\s*\[([^\]]*)\]/)
|
|
1400
1388
|
.replace('label', inline._label)
|
|
1401
1389
|
.getRegex()
|
|
1402
|
-
}
|
|
1390
|
+
};
|
|
1403
1391
|
|
|
1404
1392
|
/**
|
|
1405
1393
|
* GFM Inline Grammar
|
|
1406
1394
|
*/
|
|
1407
1395
|
|
|
1408
|
-
inline.gfm =
|
|
1396
|
+
inline.gfm = {
|
|
1397
|
+
...inline.normal,
|
|
1409
1398
|
escape: edit(inline.escape).replace('])', '~|])').getRegex(),
|
|
1410
1399
|
_extended_email: /[A-Za-z0-9._+-]+(@)[a-zA-Z0-9-_]+(?:\.[a-zA-Z0-9-_]*[a-zA-Z0-9])+(?![-_])/,
|
|
1411
1400
|
url: /^((?:ftp|https?):\/\/|www\.)(?:[a-zA-Z0-9\-]+\.?)+[^\s<]*|^email/,
|
|
1412
1401
|
_backpedal: /(?:[^?!.,:;*_'"~()&]+|\([^)]*\)|&(?![a-zA-Z0-9]+;$)|[?!.,:;*_'"~)]+(?!$))+/,
|
|
1413
1402
|
del: /^(~~?)(?=[^\s~])([\s\S]*?[^\s~])\1(?=[^~]|$)/,
|
|
1414
1403
|
text: /^([`~]+|[^`~])(?:(?= {2,}\n)|(?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@)|[\s\S]*?(?:(?=[\\<!\[`*~_]|\b_|https?:\/\/|ftp:\/\/|www\.|$)|[^ ](?= {2,}\n)|[^a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-](?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@)))/
|
|
1415
|
-
}
|
|
1404
|
+
};
|
|
1416
1405
|
|
|
1417
1406
|
inline.gfm.url = edit(inline.gfm.url, 'i')
|
|
1418
1407
|
.replace('email', inline.gfm._extended_email)
|
|
@@ -1421,13 +1410,14 @@ inline.gfm.url = edit(inline.gfm.url, 'i')
|
|
|
1421
1410
|
* GFM + Line Breaks Inline Grammar
|
|
1422
1411
|
*/
|
|
1423
1412
|
|
|
1424
|
-
inline.breaks =
|
|
1413
|
+
inline.breaks = {
|
|
1414
|
+
...inline.gfm,
|
|
1425
1415
|
br: edit(inline.br).replace('{2,}', '*').getRegex(),
|
|
1426
1416
|
text: edit(inline.gfm.text)
|
|
1427
1417
|
.replace('\\b_', '\\b_| {2,}\\n')
|
|
1428
1418
|
.replace(/\{2,\}/g, '*')
|
|
1429
1419
|
.getRegex()
|
|
1430
|
-
}
|
|
1420
|
+
};
|
|
1431
1421
|
|
|
1432
1422
|
/**
|
|
1433
1423
|
* smartypants text replacement
|
|
@@ -2504,122 +2494,194 @@ class Parser {
|
|
|
2504
2494
|
}
|
|
2505
2495
|
}
|
|
2506
2496
|
|
|
2507
|
-
|
|
2508
|
-
|
|
2509
|
-
|
|
2510
|
-
function marked(src, opt, callback) {
|
|
2511
|
-
// throw error in case of non string input
|
|
2512
|
-
if (typeof src === 'undefined' || src === null) {
|
|
2513
|
-
throw new Error('marked(): input parameter is undefined or null');
|
|
2497
|
+
class Hooks {
|
|
2498
|
+
constructor(options) {
|
|
2499
|
+
this.options = options || defaults;
|
|
2514
2500
|
}
|
|
2515
|
-
|
|
2516
|
-
|
|
2517
|
-
|
|
2501
|
+
|
|
2502
|
+
static passThroughHooks = new Set([
|
|
2503
|
+
'preprocess',
|
|
2504
|
+
'postprocess'
|
|
2505
|
+
]);
|
|
2506
|
+
|
|
2507
|
+
/**
|
|
2508
|
+
* Process markdown before marked
|
|
2509
|
+
*/
|
|
2510
|
+
preprocess(markdown) {
|
|
2511
|
+
return markdown;
|
|
2518
2512
|
}
|
|
2519
2513
|
|
|
2520
|
-
|
|
2521
|
-
|
|
2522
|
-
|
|
2514
|
+
/**
|
|
2515
|
+
* Process HTML after marked is finished
|
|
2516
|
+
*/
|
|
2517
|
+
postprocess(html) {
|
|
2518
|
+
return html;
|
|
2523
2519
|
}
|
|
2520
|
+
}
|
|
2524
2521
|
|
|
2525
|
-
|
|
2526
|
-
|
|
2522
|
+
function onError(silent, async, callback) {
|
|
2523
|
+
return (e) => {
|
|
2524
|
+
e.message += '\nPlease report this to https://github.com/markedjs/marked.';
|
|
2527
2525
|
|
|
2528
|
-
|
|
2529
|
-
|
|
2530
|
-
|
|
2526
|
+
if (silent) {
|
|
2527
|
+
const msg = '<p>An error occurred:</p><pre>'
|
|
2528
|
+
+ escape(e.message + '', true)
|
|
2529
|
+
+ '</pre>';
|
|
2530
|
+
if (async) {
|
|
2531
|
+
return Promise.resolve(msg);
|
|
2532
|
+
}
|
|
2533
|
+
if (callback) {
|
|
2534
|
+
callback(null, msg);
|
|
2535
|
+
return;
|
|
2536
|
+
}
|
|
2537
|
+
return msg;
|
|
2538
|
+
}
|
|
2531
2539
|
|
|
2532
|
-
|
|
2533
|
-
|
|
2534
|
-
} catch (e) {
|
|
2535
|
-
return callback(e);
|
|
2540
|
+
if (async) {
|
|
2541
|
+
return Promise.reject(e);
|
|
2536
2542
|
}
|
|
2543
|
+
if (callback) {
|
|
2544
|
+
callback(e);
|
|
2545
|
+
return;
|
|
2546
|
+
}
|
|
2547
|
+
throw e;
|
|
2548
|
+
};
|
|
2549
|
+
}
|
|
2537
2550
|
|
|
2538
|
-
|
|
2539
|
-
|
|
2551
|
+
function parseMarkdown(lexer, parser) {
|
|
2552
|
+
return (src, opt, callback) => {
|
|
2553
|
+
if (typeof opt === 'function') {
|
|
2554
|
+
callback = opt;
|
|
2555
|
+
opt = null;
|
|
2556
|
+
}
|
|
2540
2557
|
|
|
2541
|
-
|
|
2542
|
-
|
|
2543
|
-
|
|
2544
|
-
marked.walkTokens(tokens, opt.walkTokens);
|
|
2545
|
-
}
|
|
2546
|
-
out = Parser.parse(tokens, opt);
|
|
2547
|
-
} catch (e) {
|
|
2548
|
-
err = e;
|
|
2549
|
-
}
|
|
2550
|
-
}
|
|
2558
|
+
const origOpt = { ...opt };
|
|
2559
|
+
opt = { ...marked.defaults, ...origOpt };
|
|
2560
|
+
const throwError = onError(opt.silent, opt.async, callback);
|
|
2551
2561
|
|
|
2552
|
-
|
|
2562
|
+
// throw error in case of non string input
|
|
2563
|
+
if (typeof src === 'undefined' || src === null) {
|
|
2564
|
+
return throwError(new Error('marked(): input parameter is undefined or null'));
|
|
2565
|
+
}
|
|
2566
|
+
if (typeof src !== 'string') {
|
|
2567
|
+
return throwError(new Error('marked(): input parameter is of type '
|
|
2568
|
+
+ Object.prototype.toString.call(src) + ', string expected'));
|
|
2569
|
+
}
|
|
2553
2570
|
|
|
2554
|
-
|
|
2555
|
-
? callback(err)
|
|
2556
|
-
: callback(null, out);
|
|
2557
|
-
};
|
|
2571
|
+
checkSanitizeDeprecation(opt);
|
|
2558
2572
|
|
|
2559
|
-
if (
|
|
2560
|
-
|
|
2573
|
+
if (opt.hooks) {
|
|
2574
|
+
opt.hooks.options = opt;
|
|
2561
2575
|
}
|
|
2562
2576
|
|
|
2563
|
-
|
|
2577
|
+
if (callback) {
|
|
2578
|
+
const highlight = opt.highlight;
|
|
2579
|
+
let tokens;
|
|
2580
|
+
|
|
2581
|
+
try {
|
|
2582
|
+
if (opt.hooks) {
|
|
2583
|
+
src = opt.hooks.preprocess(src);
|
|
2584
|
+
}
|
|
2585
|
+
tokens = lexer(src, opt);
|
|
2586
|
+
} catch (e) {
|
|
2587
|
+
return throwError(e);
|
|
2588
|
+
}
|
|
2564
2589
|
|
|
2565
|
-
|
|
2590
|
+
const done = function(err) {
|
|
2591
|
+
let out;
|
|
2566
2592
|
|
|
2567
|
-
|
|
2568
|
-
|
|
2569
|
-
|
|
2570
|
-
|
|
2571
|
-
setTimeout(() => {
|
|
2572
|
-
highlight(token.text, token.lang, function(err, code) {
|
|
2573
|
-
if (err) {
|
|
2574
|
-
return done(err);
|
|
2593
|
+
if (!err) {
|
|
2594
|
+
try {
|
|
2595
|
+
if (opt.walkTokens) {
|
|
2596
|
+
marked.walkTokens(tokens, opt.walkTokens);
|
|
2575
2597
|
}
|
|
2576
|
-
|
|
2577
|
-
|
|
2578
|
-
|
|
2598
|
+
out = parser(tokens, opt);
|
|
2599
|
+
if (opt.hooks) {
|
|
2600
|
+
out = opt.hooks.postprocess(out);
|
|
2579
2601
|
}
|
|
2602
|
+
} catch (e) {
|
|
2603
|
+
err = e;
|
|
2604
|
+
}
|
|
2605
|
+
}
|
|
2580
2606
|
|
|
2581
|
-
|
|
2582
|
-
|
|
2583
|
-
|
|
2584
|
-
|
|
2585
|
-
|
|
2586
|
-
|
|
2607
|
+
opt.highlight = highlight;
|
|
2608
|
+
|
|
2609
|
+
return err
|
|
2610
|
+
? throwError(err)
|
|
2611
|
+
: callback(null, out);
|
|
2612
|
+
};
|
|
2613
|
+
|
|
2614
|
+
if (!highlight || highlight.length < 3) {
|
|
2615
|
+
return done();
|
|
2587
2616
|
}
|
|
2588
|
-
});
|
|
2589
2617
|
|
|
2590
|
-
|
|
2591
|
-
|
|
2618
|
+
delete opt.highlight;
|
|
2619
|
+
|
|
2620
|
+
if (!tokens.length) return done();
|
|
2621
|
+
|
|
2622
|
+
let pending = 0;
|
|
2623
|
+
marked.walkTokens(tokens, function(token) {
|
|
2624
|
+
if (token.type === 'code') {
|
|
2625
|
+
pending++;
|
|
2626
|
+
setTimeout(() => {
|
|
2627
|
+
highlight(token.text, token.lang, function(err, code) {
|
|
2628
|
+
if (err) {
|
|
2629
|
+
return done(err);
|
|
2630
|
+
}
|
|
2631
|
+
if (code != null && code !== token.text) {
|
|
2632
|
+
token.text = code;
|
|
2633
|
+
token.escaped = true;
|
|
2634
|
+
}
|
|
2635
|
+
|
|
2636
|
+
pending--;
|
|
2637
|
+
if (pending === 0) {
|
|
2638
|
+
done();
|
|
2639
|
+
}
|
|
2640
|
+
});
|
|
2641
|
+
}, 0);
|
|
2642
|
+
}
|
|
2643
|
+
});
|
|
2644
|
+
|
|
2645
|
+
if (pending === 0) {
|
|
2646
|
+
done();
|
|
2647
|
+
}
|
|
2648
|
+
|
|
2649
|
+
return;
|
|
2592
2650
|
}
|
|
2593
2651
|
|
|
2594
|
-
|
|
2595
|
-
|
|
2652
|
+
if (opt.async) {
|
|
2653
|
+
return Promise.resolve(opt.hooks ? opt.hooks.preprocess(src) : src)
|
|
2654
|
+
.then(src => lexer(src, opt))
|
|
2655
|
+
.then(tokens => opt.walkTokens ? Promise.all(marked.walkTokens(tokens, opt.walkTokens)).then(() => tokens) : tokens)
|
|
2656
|
+
.then(tokens => parser(tokens, opt))
|
|
2657
|
+
.then(html => opt.hooks ? opt.hooks.postprocess(html) : html)
|
|
2658
|
+
.catch(throwError);
|
|
2659
|
+
}
|
|
2596
2660
|
|
|
2597
|
-
|
|
2598
|
-
|
|
2599
|
-
|
|
2600
|
-
|
|
2601
|
-
|
|
2602
|
-
|
|
2661
|
+
try {
|
|
2662
|
+
if (opt.hooks) {
|
|
2663
|
+
src = opt.hooks.preprocess(src);
|
|
2664
|
+
}
|
|
2665
|
+
const tokens = lexer(src, opt);
|
|
2666
|
+
if (opt.walkTokens) {
|
|
2667
|
+
marked.walkTokens(tokens, opt.walkTokens);
|
|
2668
|
+
}
|
|
2669
|
+
let html = parser(tokens, opt);
|
|
2670
|
+
if (opt.hooks) {
|
|
2671
|
+
html = opt.hooks.postprocess(html);
|
|
2672
|
+
}
|
|
2673
|
+
return html;
|
|
2674
|
+
} catch (e) {
|
|
2675
|
+
return throwError(e);
|
|
2603
2676
|
}
|
|
2604
|
-
|
|
2605
|
-
|
|
2677
|
+
};
|
|
2678
|
+
}
|
|
2606
2679
|
|
|
2607
|
-
|
|
2608
|
-
|
|
2609
|
-
|
|
2610
|
-
|
|
2611
|
-
|
|
2612
|
-
.then(() => {
|
|
2613
|
-
return Parser.parse(tokens, opt);
|
|
2614
|
-
})
|
|
2615
|
-
.catch(onError);
|
|
2616
|
-
}
|
|
2617
|
-
marked.walkTokens(tokens, opt.walkTokens);
|
|
2618
|
-
}
|
|
2619
|
-
return Parser.parse(tokens, opt);
|
|
2620
|
-
} catch (e) {
|
|
2621
|
-
onError(e);
|
|
2622
|
-
}
|
|
2680
|
+
/**
|
|
2681
|
+
* Marked
|
|
2682
|
+
*/
|
|
2683
|
+
function marked(src, opt, callback) {
|
|
2684
|
+
return parseMarkdown(Lexer.lex, Parser.parse)(src, opt, callback);
|
|
2623
2685
|
}
|
|
2624
2686
|
|
|
2625
2687
|
/**
|
|
@@ -2628,7 +2690,7 @@ function marked(src, opt, callback) {
|
|
|
2628
2690
|
|
|
2629
2691
|
marked.options =
|
|
2630
2692
|
marked.setOptions = function(opt) {
|
|
2631
|
-
|
|
2693
|
+
marked.defaults = { ...marked.defaults, ...opt };
|
|
2632
2694
|
changeDefaults(marked.defaults);
|
|
2633
2695
|
return marked;
|
|
2634
2696
|
};
|
|
@@ -2646,10 +2708,10 @@ marked.use = function(...args) {
|
|
|
2646
2708
|
|
|
2647
2709
|
args.forEach((pack) => {
|
|
2648
2710
|
// copy options to new object
|
|
2649
|
-
const opts =
|
|
2711
|
+
const opts = { ...pack };
|
|
2650
2712
|
|
|
2651
2713
|
// set async to true if it was set to true before
|
|
2652
|
-
opts.async = marked.defaults.async || opts.async;
|
|
2714
|
+
opts.async = marked.defaults.async || opts.async || false;
|
|
2653
2715
|
|
|
2654
2716
|
// ==-- Parse "addon" extensions --== //
|
|
2655
2717
|
if (pack.extensions) {
|
|
@@ -2736,6 +2798,35 @@ marked.use = function(...args) {
|
|
|
2736
2798
|
opts.tokenizer = tokenizer;
|
|
2737
2799
|
}
|
|
2738
2800
|
|
|
2801
|
+
// ==-- Parse Hooks extensions --== //
|
|
2802
|
+
if (pack.hooks) {
|
|
2803
|
+
const hooks = marked.defaults.hooks || new Hooks();
|
|
2804
|
+
for (const prop in pack.hooks) {
|
|
2805
|
+
const prevHook = hooks[prop];
|
|
2806
|
+
if (Hooks.passThroughHooks.has(prop)) {
|
|
2807
|
+
hooks[prop] = (arg) => {
|
|
2808
|
+
if (marked.defaults.async) {
|
|
2809
|
+
return Promise.resolve(pack.hooks[prop].call(hooks, arg)).then(ret => {
|
|
2810
|
+
return prevHook.call(hooks, ret);
|
|
2811
|
+
});
|
|
2812
|
+
}
|
|
2813
|
+
|
|
2814
|
+
const ret = pack.hooks[prop].call(hooks, arg);
|
|
2815
|
+
return prevHook.call(hooks, ret);
|
|
2816
|
+
};
|
|
2817
|
+
} else {
|
|
2818
|
+
hooks[prop] = (...args) => {
|
|
2819
|
+
let ret = pack.hooks[prop].apply(hooks, args);
|
|
2820
|
+
if (ret === false) {
|
|
2821
|
+
ret = prevHook.apply(hooks, args);
|
|
2822
|
+
}
|
|
2823
|
+
return ret;
|
|
2824
|
+
};
|
|
2825
|
+
}
|
|
2826
|
+
}
|
|
2827
|
+
opts.hooks = hooks;
|
|
2828
|
+
}
|
|
2829
|
+
|
|
2739
2830
|
// ==-- Parse WalkTokens extensions --== //
|
|
2740
2831
|
if (pack.walkTokens) {
|
|
2741
2832
|
const walkTokens = marked.defaults.walkTokens;
|
|
@@ -2795,35 +2886,7 @@ marked.walkTokens = function(tokens, callback) {
|
|
|
2795
2886
|
* Parse Inline
|
|
2796
2887
|
* @param {string} src
|
|
2797
2888
|
*/
|
|
2798
|
-
marked.parseInline =
|
|
2799
|
-
// throw error in case of non string input
|
|
2800
|
-
if (typeof src === 'undefined' || src === null) {
|
|
2801
|
-
throw new Error('marked.parseInline(): input parameter is undefined or null');
|
|
2802
|
-
}
|
|
2803
|
-
if (typeof src !== 'string') {
|
|
2804
|
-
throw new Error('marked.parseInline(): input parameter is of type '
|
|
2805
|
-
+ Object.prototype.toString.call(src) + ', string expected');
|
|
2806
|
-
}
|
|
2807
|
-
|
|
2808
|
-
opt = merge({}, marked.defaults, opt || {});
|
|
2809
|
-
checkSanitizeDeprecation(opt);
|
|
2810
|
-
|
|
2811
|
-
try {
|
|
2812
|
-
const tokens = Lexer.lexInline(src, opt);
|
|
2813
|
-
if (opt.walkTokens) {
|
|
2814
|
-
marked.walkTokens(tokens, opt.walkTokens);
|
|
2815
|
-
}
|
|
2816
|
-
return Parser.parseInline(tokens, opt);
|
|
2817
|
-
} catch (e) {
|
|
2818
|
-
e.message += '\nPlease report this to https://github.com/markedjs/marked.';
|
|
2819
|
-
if (opt.silent) {
|
|
2820
|
-
return '<p>An error occurred:</p><pre>'
|
|
2821
|
-
+ escape(e.message + '', true)
|
|
2822
|
-
+ '</pre>';
|
|
2823
|
-
}
|
|
2824
|
-
throw e;
|
|
2825
|
-
}
|
|
2826
|
-
};
|
|
2889
|
+
marked.parseInline = parseMarkdown(Lexer.lexInline, Parser.parseInline);
|
|
2827
2890
|
|
|
2828
2891
|
/**
|
|
2829
2892
|
* Expose
|
|
@@ -2836,6 +2899,7 @@ marked.Lexer = Lexer;
|
|
|
2836
2899
|
marked.lexer = Lexer.lex;
|
|
2837
2900
|
marked.Tokenizer = Tokenizer;
|
|
2838
2901
|
marked.Slugger = Slugger;
|
|
2902
|
+
marked.Hooks = Hooks;
|
|
2839
2903
|
marked.parse = marked;
|
|
2840
2904
|
|
|
2841
2905
|
const options = marked.options;
|
package/dist/HASH
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
18754d60df1
|
package/dist/screenshoot.html
CHANGED
|
@@ -4,4 +4,4 @@
|
|
|
4
4
|
}
|
|
5
5
|
body {
|
|
6
6
|
background: #ddd;
|
|
7
|
-
}</style></head><body><script defer="defer" src="https://vcdn.subiz-cdn.com/widget-v4/public/
|
|
7
|
+
}</style></head><body><script defer="defer" src="https://vcdn.subiz-cdn.com/widget-v4/public/18754d60df1.screenshoot.js"></script></body></html>
|