@abi-software/map-side-bar 1.3.30 → 1.3.31

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.
@@ -157,13 +157,6 @@ module.exports = require("core-js/modules/web.dom-collections.iterator");
157
157
 
158
158
  /***/ }),
159
159
 
160
- /***/ "1d61":
161
- /***/ (function(module, exports) {
162
-
163
- module.exports = require("marked");
164
-
165
- /***/ }),
166
-
167
160
  /***/ "2175":
168
161
  /***/ (function(module, exports) {
169
162
 
@@ -422,6 +415,3082 @@ module.exports = require("core-js/modules/es.number.constructor");
422
415
 
423
416
  module.exports = require("regenerator-runtime/runtime");
424
417
 
418
+ /***/ }),
419
+
420
+ /***/ "7c5c":
421
+ /***/ (function(module, exports, __webpack_require__) {
422
+
423
+ /**
424
+ * marked - a markdown parser
425
+ * Copyright (c) 2011-2022, Christopher Jeffrey. (MIT Licensed)
426
+ * https://github.com/markedjs/marked
427
+ */
428
+
429
+ /**
430
+ * DO NOT EDIT THIS FILE
431
+ * The code in this file is generated from files in ./src/
432
+ */
433
+
434
+ (function (global, factory) {
435
+ true ? factory(exports) :
436
+ undefined;
437
+ })(this, (function (exports) { 'use strict';
438
+
439
+ function _defineProperties(target, props) {
440
+ for (var i = 0; i < props.length; i++) {
441
+ var descriptor = props[i];
442
+ descriptor.enumerable = descriptor.enumerable || false;
443
+ descriptor.configurable = true;
444
+ if ("value" in descriptor) descriptor.writable = true;
445
+ Object.defineProperty(target, descriptor.key, descriptor);
446
+ }
447
+ }
448
+
449
+ function _createClass(Constructor, protoProps, staticProps) {
450
+ if (protoProps) _defineProperties(Constructor.prototype, protoProps);
451
+ if (staticProps) _defineProperties(Constructor, staticProps);
452
+ Object.defineProperty(Constructor, "prototype", {
453
+ writable: false
454
+ });
455
+ return Constructor;
456
+ }
457
+
458
+ function _unsupportedIterableToArray(o, minLen) {
459
+ if (!o) return;
460
+ if (typeof o === "string") return _arrayLikeToArray(o, minLen);
461
+ var n = Object.prototype.toString.call(o).slice(8, -1);
462
+ if (n === "Object" && o.constructor) n = o.constructor.name;
463
+ if (n === "Map" || n === "Set") return Array.from(o);
464
+ if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen);
465
+ }
466
+
467
+ function _arrayLikeToArray(arr, len) {
468
+ if (len == null || len > arr.length) len = arr.length;
469
+
470
+ for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i];
471
+
472
+ return arr2;
473
+ }
474
+
475
+ function _createForOfIteratorHelperLoose(o, allowArrayLike) {
476
+ var it = typeof Symbol !== "undefined" && o[Symbol.iterator] || o["@@iterator"];
477
+ if (it) return (it = it.call(o)).next.bind(it);
478
+
479
+ if (Array.isArray(o) || (it = _unsupportedIterableToArray(o)) || allowArrayLike && o && typeof o.length === "number") {
480
+ if (it) o = it;
481
+ var i = 0;
482
+ return function () {
483
+ if (i >= o.length) return {
484
+ done: true
485
+ };
486
+ return {
487
+ done: false,
488
+ value: o[i++]
489
+ };
490
+ };
491
+ }
492
+
493
+ throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
494
+ }
495
+
496
+ function getDefaults() {
497
+ return {
498
+ async: false,
499
+ baseUrl: null,
500
+ breaks: false,
501
+ extensions: null,
502
+ gfm: true,
503
+ headerIds: true,
504
+ headerPrefix: '',
505
+ highlight: null,
506
+ langPrefix: 'language-',
507
+ mangle: true,
508
+ pedantic: false,
509
+ renderer: null,
510
+ sanitize: false,
511
+ sanitizer: null,
512
+ silent: false,
513
+ smartypants: false,
514
+ tokenizer: null,
515
+ walkTokens: null,
516
+ xhtml: false
517
+ };
518
+ }
519
+ exports.defaults = getDefaults();
520
+ function changeDefaults(newDefaults) {
521
+ exports.defaults = newDefaults;
522
+ }
523
+
524
+ /**
525
+ * Helpers
526
+ */
527
+ var escapeTest = /[&<>"']/;
528
+ var escapeReplace = /[&<>"']/g;
529
+ var escapeTestNoEncode = /[<>"']|&(?!#?\w+;)/;
530
+ var escapeReplaceNoEncode = /[<>"']|&(?!#?\w+;)/g;
531
+ var escapeReplacements = {
532
+ '&': '&amp;',
533
+ '<': '&lt;',
534
+ '>': '&gt;',
535
+ '"': '&quot;',
536
+ "'": '&#39;'
537
+ };
538
+
539
+ var getEscapeReplacement = function getEscapeReplacement(ch) {
540
+ return escapeReplacements[ch];
541
+ };
542
+
543
+ function escape(html, encode) {
544
+ if (encode) {
545
+ if (escapeTest.test(html)) {
546
+ return html.replace(escapeReplace, getEscapeReplacement);
547
+ }
548
+ } else {
549
+ if (escapeTestNoEncode.test(html)) {
550
+ return html.replace(escapeReplaceNoEncode, getEscapeReplacement);
551
+ }
552
+ }
553
+
554
+ return html;
555
+ }
556
+ var unescapeTest = /&(#(?:\d+)|(?:#x[0-9A-Fa-f]+)|(?:\w+));?/ig;
557
+ /**
558
+ * @param {string} html
559
+ */
560
+
561
+ function unescape(html) {
562
+ // explicitly match decimal, hex, and named HTML entities
563
+ return html.replace(unescapeTest, function (_, n) {
564
+ n = n.toLowerCase();
565
+ if (n === 'colon') return ':';
566
+
567
+ if (n.charAt(0) === '#') {
568
+ return n.charAt(1) === 'x' ? String.fromCharCode(parseInt(n.substring(2), 16)) : String.fromCharCode(+n.substring(1));
569
+ }
570
+
571
+ return '';
572
+ });
573
+ }
574
+ var caret = /(^|[^\[])\^/g;
575
+ /**
576
+ * @param {string | RegExp} regex
577
+ * @param {string} opt
578
+ */
579
+
580
+ function edit(regex, opt) {
581
+ regex = typeof regex === 'string' ? regex : regex.source;
582
+ opt = opt || '';
583
+ var obj = {
584
+ replace: function replace(name, val) {
585
+ val = val.source || val;
586
+ val = val.replace(caret, '$1');
587
+ regex = regex.replace(name, val);
588
+ return obj;
589
+ },
590
+ getRegex: function getRegex() {
591
+ return new RegExp(regex, opt);
592
+ }
593
+ };
594
+ return obj;
595
+ }
596
+ var nonWordAndColonTest = /[^\w:]/g;
597
+ var originIndependentUrl = /^$|^[a-z][a-z0-9+.-]*:|^[?#]/i;
598
+ /**
599
+ * @param {boolean} sanitize
600
+ * @param {string} base
601
+ * @param {string} href
602
+ */
603
+
604
+ function cleanUrl(sanitize, base, href) {
605
+ if (sanitize) {
606
+ var prot;
607
+
608
+ try {
609
+ prot = decodeURIComponent(unescape(href)).replace(nonWordAndColonTest, '').toLowerCase();
610
+ } catch (e) {
611
+ return null;
612
+ }
613
+
614
+ if (prot.indexOf('javascript:') === 0 || prot.indexOf('vbscript:') === 0 || prot.indexOf('data:') === 0) {
615
+ return null;
616
+ }
617
+ }
618
+
619
+ if (base && !originIndependentUrl.test(href)) {
620
+ href = resolveUrl(base, href);
621
+ }
622
+
623
+ try {
624
+ href = encodeURI(href).replace(/%25/g, '%');
625
+ } catch (e) {
626
+ return null;
627
+ }
628
+
629
+ return href;
630
+ }
631
+ var baseUrls = {};
632
+ var justDomain = /^[^:]+:\/*[^/]*$/;
633
+ var protocol = /^([^:]+:)[\s\S]*$/;
634
+ var domain = /^([^:]+:\/*[^/]*)[\s\S]*$/;
635
+ /**
636
+ * @param {string} base
637
+ * @param {string} href
638
+ */
639
+
640
+ function resolveUrl(base, href) {
641
+ if (!baseUrls[' ' + base]) {
642
+ // we can ignore everything in base after the last slash of its path component,
643
+ // but we might need to add _that_
644
+ // https://tools.ietf.org/html/rfc3986#section-3
645
+ if (justDomain.test(base)) {
646
+ baseUrls[' ' + base] = base + '/';
647
+ } else {
648
+ baseUrls[' ' + base] = rtrim(base, '/', true);
649
+ }
650
+ }
651
+
652
+ base = baseUrls[' ' + base];
653
+ var relativeBase = base.indexOf(':') === -1;
654
+
655
+ if (href.substring(0, 2) === '//') {
656
+ if (relativeBase) {
657
+ return href;
658
+ }
659
+
660
+ return base.replace(protocol, '$1') + href;
661
+ } else if (href.charAt(0) === '/') {
662
+ if (relativeBase) {
663
+ return href;
664
+ }
665
+
666
+ return base.replace(domain, '$1') + href;
667
+ } else {
668
+ return base + href;
669
+ }
670
+ }
671
+ var noopTest = {
672
+ exec: function noopTest() {}
673
+ };
674
+ function merge(obj) {
675
+ var i = 1,
676
+ target,
677
+ key;
678
+
679
+ for (; i < arguments.length; i++) {
680
+ target = arguments[i];
681
+
682
+ for (key in target) {
683
+ if (Object.prototype.hasOwnProperty.call(target, key)) {
684
+ obj[key] = target[key];
685
+ }
686
+ }
687
+ }
688
+
689
+ return obj;
690
+ }
691
+ function splitCells(tableRow, count) {
692
+ // ensure that every cell-delimiting pipe has a space
693
+ // before it to distinguish it from an escaped pipe
694
+ var row = tableRow.replace(/\|/g, function (match, offset, str) {
695
+ var escaped = false,
696
+ curr = offset;
697
+
698
+ while (--curr >= 0 && str[curr] === '\\') {
699
+ escaped = !escaped;
700
+ }
701
+
702
+ if (escaped) {
703
+ // odd number of slashes means | is escaped
704
+ // so we leave it alone
705
+ return '|';
706
+ } else {
707
+ // add space before unescaped |
708
+ return ' |';
709
+ }
710
+ }),
711
+ cells = row.split(/ \|/);
712
+ var i = 0; // First/last cell in a row cannot be empty if it has no leading/trailing pipe
713
+
714
+ if (!cells[0].trim()) {
715
+ cells.shift();
716
+ }
717
+
718
+ if (cells.length > 0 && !cells[cells.length - 1].trim()) {
719
+ cells.pop();
720
+ }
721
+
722
+ if (cells.length > count) {
723
+ cells.splice(count);
724
+ } else {
725
+ while (cells.length < count) {
726
+ cells.push('');
727
+ }
728
+ }
729
+
730
+ for (; i < cells.length; i++) {
731
+ // leading or trailing whitespace is ignored per the gfm spec
732
+ cells[i] = cells[i].trim().replace(/\\\|/g, '|');
733
+ }
734
+
735
+ return cells;
736
+ }
737
+ /**
738
+ * Remove trailing 'c's. Equivalent to str.replace(/c*$/, '').
739
+ * /c*$/ is vulnerable to REDOS.
740
+ *
741
+ * @param {string} str
742
+ * @param {string} c
743
+ * @param {boolean} invert Remove suffix of non-c chars instead. Default falsey.
744
+ */
745
+
746
+ function rtrim(str, c, invert) {
747
+ var l = str.length;
748
+
749
+ if (l === 0) {
750
+ return '';
751
+ } // Length of suffix matching the invert condition.
752
+
753
+
754
+ var suffLen = 0; // Step left until we fail to match the invert condition.
755
+
756
+ while (suffLen < l) {
757
+ var currChar = str.charAt(l - suffLen - 1);
758
+
759
+ if (currChar === c && !invert) {
760
+ suffLen++;
761
+ } else if (currChar !== c && invert) {
762
+ suffLen++;
763
+ } else {
764
+ break;
765
+ }
766
+ }
767
+
768
+ return str.slice(0, l - suffLen);
769
+ }
770
+ function findClosingBracket(str, b) {
771
+ if (str.indexOf(b[1]) === -1) {
772
+ return -1;
773
+ }
774
+
775
+ var l = str.length;
776
+ var level = 0,
777
+ i = 0;
778
+
779
+ for (; i < l; i++) {
780
+ if (str[i] === '\\') {
781
+ i++;
782
+ } else if (str[i] === b[0]) {
783
+ level++;
784
+ } else if (str[i] === b[1]) {
785
+ level--;
786
+
787
+ if (level < 0) {
788
+ return i;
789
+ }
790
+ }
791
+ }
792
+
793
+ return -1;
794
+ }
795
+ function checkSanitizeDeprecation(opt) {
796
+ if (opt && opt.sanitize && !opt.silent) {
797
+ console.warn('marked(): sanitize and sanitizer parameters are deprecated since version 0.7.0, should not be used and will be removed in the future. Read more here: https://marked.js.org/#/USING_ADVANCED.md#options');
798
+ }
799
+ } // copied from https://stackoverflow.com/a/5450113/806777
800
+
801
+ /**
802
+ * @param {string} pattern
803
+ * @param {number} count
804
+ */
805
+
806
+ function repeatString(pattern, count) {
807
+ if (count < 1) {
808
+ return '';
809
+ }
810
+
811
+ var result = '';
812
+
813
+ while (count > 1) {
814
+ if (count & 1) {
815
+ result += pattern;
816
+ }
817
+
818
+ count >>= 1;
819
+ pattern += pattern;
820
+ }
821
+
822
+ return result + pattern;
823
+ }
824
+
825
+ function outputLink(cap, link, raw, lexer) {
826
+ var href = link.href;
827
+ var title = link.title ? escape(link.title) : null;
828
+ var text = cap[1].replace(/\\([\[\]])/g, '$1');
829
+
830
+ if (cap[0].charAt(0) !== '!') {
831
+ lexer.state.inLink = true;
832
+ var token = {
833
+ type: 'link',
834
+ raw: raw,
835
+ href: href,
836
+ title: title,
837
+ text: text,
838
+ tokens: lexer.inlineTokens(text)
839
+ };
840
+ lexer.state.inLink = false;
841
+ return token;
842
+ }
843
+
844
+ return {
845
+ type: 'image',
846
+ raw: raw,
847
+ href: href,
848
+ title: title,
849
+ text: escape(text)
850
+ };
851
+ }
852
+
853
+ function indentCodeCompensation(raw, text) {
854
+ var matchIndentToCode = raw.match(/^(\s+)(?:```)/);
855
+
856
+ if (matchIndentToCode === null) {
857
+ return text;
858
+ }
859
+
860
+ var indentToCode = matchIndentToCode[1];
861
+ return text.split('\n').map(function (node) {
862
+ var matchIndentInNode = node.match(/^\s+/);
863
+
864
+ if (matchIndentInNode === null) {
865
+ return node;
866
+ }
867
+
868
+ var indentInNode = matchIndentInNode[0];
869
+
870
+ if (indentInNode.length >= indentToCode.length) {
871
+ return node.slice(indentToCode.length);
872
+ }
873
+
874
+ return node;
875
+ }).join('\n');
876
+ }
877
+ /**
878
+ * Tokenizer
879
+ */
880
+
881
+
882
+ var Tokenizer = /*#__PURE__*/function () {
883
+ function Tokenizer(options) {
884
+ this.options = options || exports.defaults;
885
+ }
886
+
887
+ var _proto = Tokenizer.prototype;
888
+
889
+ _proto.space = function space(src) {
890
+ var cap = this.rules.block.newline.exec(src);
891
+
892
+ if (cap && cap[0].length > 0) {
893
+ return {
894
+ type: 'space',
895
+ raw: cap[0]
896
+ };
897
+ }
898
+ };
899
+
900
+ _proto.code = function code(src) {
901
+ var cap = this.rules.block.code.exec(src);
902
+
903
+ if (cap) {
904
+ var text = cap[0].replace(/^ {1,4}/gm, '');
905
+ return {
906
+ type: 'code',
907
+ raw: cap[0],
908
+ codeBlockStyle: 'indented',
909
+ text: !this.options.pedantic ? rtrim(text, '\n') : text
910
+ };
911
+ }
912
+ };
913
+
914
+ _proto.fences = function fences(src) {
915
+ var cap = this.rules.block.fences.exec(src);
916
+
917
+ if (cap) {
918
+ var raw = cap[0];
919
+ var text = indentCodeCompensation(raw, cap[3] || '');
920
+ return {
921
+ type: 'code',
922
+ raw: raw,
923
+ lang: cap[2] ? cap[2].trim() : cap[2],
924
+ text: text
925
+ };
926
+ }
927
+ };
928
+
929
+ _proto.heading = function heading(src) {
930
+ var cap = this.rules.block.heading.exec(src);
931
+
932
+ if (cap) {
933
+ var text = cap[2].trim(); // remove trailing #s
934
+
935
+ if (/#$/.test(text)) {
936
+ var trimmed = rtrim(text, '#');
937
+
938
+ if (this.options.pedantic) {
939
+ text = trimmed.trim();
940
+ } else if (!trimmed || / $/.test(trimmed)) {
941
+ // CommonMark requires space before trailing #s
942
+ text = trimmed.trim();
943
+ }
944
+ }
945
+
946
+ return {
947
+ type: 'heading',
948
+ raw: cap[0],
949
+ depth: cap[1].length,
950
+ text: text,
951
+ tokens: this.lexer.inline(text)
952
+ };
953
+ }
954
+ };
955
+
956
+ _proto.hr = function hr(src) {
957
+ var cap = this.rules.block.hr.exec(src);
958
+
959
+ if (cap) {
960
+ return {
961
+ type: 'hr',
962
+ raw: cap[0]
963
+ };
964
+ }
965
+ };
966
+
967
+ _proto.blockquote = function blockquote(src) {
968
+ var cap = this.rules.block.blockquote.exec(src);
969
+
970
+ if (cap) {
971
+ var text = cap[0].replace(/^ *>[ \t]?/gm, '');
972
+ return {
973
+ type: 'blockquote',
974
+ raw: cap[0],
975
+ tokens: this.lexer.blockTokens(text, []),
976
+ text: text
977
+ };
978
+ }
979
+ };
980
+
981
+ _proto.list = function list(src) {
982
+ var cap = this.rules.block.list.exec(src);
983
+
984
+ if (cap) {
985
+ var raw, istask, ischecked, indent, i, blankLine, endsWithBlankLine, line, nextLine, rawLine, itemContents, endEarly;
986
+ var bull = cap[1].trim();
987
+ var isordered = bull.length > 1;
988
+ var list = {
989
+ type: 'list',
990
+ raw: '',
991
+ ordered: isordered,
992
+ start: isordered ? +bull.slice(0, -1) : '',
993
+ loose: false,
994
+ items: []
995
+ };
996
+ bull = isordered ? "\\d{1,9}\\" + bull.slice(-1) : "\\" + bull;
997
+
998
+ if (this.options.pedantic) {
999
+ bull = isordered ? bull : '[*+-]';
1000
+ } // Get next list item
1001
+
1002
+
1003
+ var itemRegex = new RegExp("^( {0,3}" + bull + ")((?:[\t ][^\\n]*)?(?:\\n|$))"); // Check if current bullet point can start a new List Item
1004
+
1005
+ while (src) {
1006
+ endEarly = false;
1007
+
1008
+ if (!(cap = itemRegex.exec(src))) {
1009
+ break;
1010
+ }
1011
+
1012
+ if (this.rules.block.hr.test(src)) {
1013
+ // End list if bullet was actually HR (possibly move into itemRegex?)
1014
+ break;
1015
+ }
1016
+
1017
+ raw = cap[0];
1018
+ src = src.substring(raw.length);
1019
+ line = cap[2].split('\n', 1)[0];
1020
+ nextLine = src.split('\n', 1)[0];
1021
+
1022
+ if (this.options.pedantic) {
1023
+ indent = 2;
1024
+ itemContents = line.trimLeft();
1025
+ } else {
1026
+ indent = cap[2].search(/[^ ]/); // Find first non-space char
1027
+
1028
+ indent = indent > 4 ? 1 : indent; // Treat indented code blocks (> 4 spaces) as having only 1 indent
1029
+
1030
+ itemContents = line.slice(indent);
1031
+ indent += cap[1].length;
1032
+ }
1033
+
1034
+ blankLine = false;
1035
+
1036
+ if (!line && /^ *$/.test(nextLine)) {
1037
+ // Items begin with at most one blank line
1038
+ raw += nextLine + '\n';
1039
+ src = src.substring(nextLine.length + 1);
1040
+ endEarly = true;
1041
+ }
1042
+
1043
+ if (!endEarly) {
1044
+ var nextBulletRegex = new RegExp("^ {0," + Math.min(3, indent - 1) + "}(?:[*+-]|\\d{1,9}[.)])((?: [^\\n]*)?(?:\\n|$))");
1045
+ var hrRegex = new RegExp("^ {0," + Math.min(3, indent - 1) + "}((?:- *){3,}|(?:_ *){3,}|(?:\\* *){3,})(?:\\n+|$)");
1046
+ var fencesBeginRegex = new RegExp("^ {0," + Math.min(3, indent - 1) + "}(?:```|~~~)");
1047
+ var headingBeginRegex = new RegExp("^ {0," + Math.min(3, indent - 1) + "}#"); // Check if following lines should be included in List Item
1048
+
1049
+ while (src) {
1050
+ rawLine = src.split('\n', 1)[0];
1051
+ line = rawLine; // Re-align to follow commonmark nesting rules
1052
+
1053
+ if (this.options.pedantic) {
1054
+ line = line.replace(/^ {1,4}(?=( {4})*[^ ])/g, ' ');
1055
+ } // End list item if found code fences
1056
+
1057
+
1058
+ if (fencesBeginRegex.test(line)) {
1059
+ break;
1060
+ } // End list item if found start of new heading
1061
+
1062
+
1063
+ if (headingBeginRegex.test(line)) {
1064
+ break;
1065
+ } // End list item if found start of new bullet
1066
+
1067
+
1068
+ if (nextBulletRegex.test(line)) {
1069
+ break;
1070
+ } // Horizontal rule found
1071
+
1072
+
1073
+ if (hrRegex.test(src)) {
1074
+ break;
1075
+ }
1076
+
1077
+ if (line.search(/[^ ]/) >= indent || !line.trim()) {
1078
+ // Dedent if possible
1079
+ itemContents += '\n' + line.slice(indent);
1080
+ } else if (!blankLine) {
1081
+ // Until blank line, item doesn't need indentation
1082
+ itemContents += '\n' + line;
1083
+ } else {
1084
+ // Otherwise, improper indentation ends this item
1085
+ break;
1086
+ }
1087
+
1088
+ if (!blankLine && !line.trim()) {
1089
+ // Check if current line is blank
1090
+ blankLine = true;
1091
+ }
1092
+
1093
+ raw += rawLine + '\n';
1094
+ src = src.substring(rawLine.length + 1);
1095
+ }
1096
+ }
1097
+
1098
+ if (!list.loose) {
1099
+ // If the previous item ended with a blank line, the list is loose
1100
+ if (endsWithBlankLine) {
1101
+ list.loose = true;
1102
+ } else if (/\n *\n *$/.test(raw)) {
1103
+ endsWithBlankLine = true;
1104
+ }
1105
+ } // Check for task list items
1106
+
1107
+
1108
+ if (this.options.gfm) {
1109
+ istask = /^\[[ xX]\] /.exec(itemContents);
1110
+
1111
+ if (istask) {
1112
+ ischecked = istask[0] !== '[ ] ';
1113
+ itemContents = itemContents.replace(/^\[[ xX]\] +/, '');
1114
+ }
1115
+ }
1116
+
1117
+ list.items.push({
1118
+ type: 'list_item',
1119
+ raw: raw,
1120
+ task: !!istask,
1121
+ checked: ischecked,
1122
+ loose: false,
1123
+ text: itemContents
1124
+ });
1125
+ list.raw += raw;
1126
+ } // Do not consume newlines at end of final item. Alternatively, make itemRegex *start* with any newlines to simplify/speed up endsWithBlankLine logic
1127
+
1128
+
1129
+ list.items[list.items.length - 1].raw = raw.trimRight();
1130
+ list.items[list.items.length - 1].text = itemContents.trimRight();
1131
+ list.raw = list.raw.trimRight();
1132
+ var l = list.items.length; // Item child tokens handled here at end because we needed to have the final item to trim it first
1133
+
1134
+ for (i = 0; i < l; i++) {
1135
+ this.lexer.state.top = false;
1136
+ list.items[i].tokens = this.lexer.blockTokens(list.items[i].text, []);
1137
+ var spacers = list.items[i].tokens.filter(function (t) {
1138
+ return t.type === 'space';
1139
+ });
1140
+ var hasMultipleLineBreaks = spacers.every(function (t) {
1141
+ var chars = t.raw.split('');
1142
+ var lineBreaks = 0;
1143
+
1144
+ for (var _iterator = _createForOfIteratorHelperLoose(chars), _step; !(_step = _iterator()).done;) {
1145
+ var _char = _step.value;
1146
+
1147
+ if (_char === '\n') {
1148
+ lineBreaks += 1;
1149
+ }
1150
+
1151
+ if (lineBreaks > 1) {
1152
+ return true;
1153
+ }
1154
+ }
1155
+
1156
+ return false;
1157
+ });
1158
+
1159
+ if (!list.loose && spacers.length && hasMultipleLineBreaks) {
1160
+ // Having a single line break doesn't mean a list is loose. A single line break is terminating the last list item
1161
+ list.loose = true;
1162
+ list.items[i].loose = true;
1163
+ }
1164
+ }
1165
+
1166
+ return list;
1167
+ }
1168
+ };
1169
+
1170
+ _proto.html = function html(src) {
1171
+ var cap = this.rules.block.html.exec(src);
1172
+
1173
+ if (cap) {
1174
+ var token = {
1175
+ type: 'html',
1176
+ raw: cap[0],
1177
+ pre: !this.options.sanitizer && (cap[1] === 'pre' || cap[1] === 'script' || cap[1] === 'style'),
1178
+ text: cap[0]
1179
+ };
1180
+
1181
+ if (this.options.sanitize) {
1182
+ var text = this.options.sanitizer ? this.options.sanitizer(cap[0]) : escape(cap[0]);
1183
+ token.type = 'paragraph';
1184
+ token.text = text;
1185
+ token.tokens = this.lexer.inline(text);
1186
+ }
1187
+
1188
+ return token;
1189
+ }
1190
+ };
1191
+
1192
+ _proto.def = function def(src) {
1193
+ var cap = this.rules.block.def.exec(src);
1194
+
1195
+ if (cap) {
1196
+ if (cap[3]) cap[3] = cap[3].substring(1, cap[3].length - 1);
1197
+ var tag = cap[1].toLowerCase().replace(/\s+/g, ' ');
1198
+ return {
1199
+ type: 'def',
1200
+ tag: tag,
1201
+ raw: cap[0],
1202
+ href: cap[2],
1203
+ title: cap[3]
1204
+ };
1205
+ }
1206
+ };
1207
+
1208
+ _proto.table = function table(src) {
1209
+ var cap = this.rules.block.table.exec(src);
1210
+
1211
+ if (cap) {
1212
+ var item = {
1213
+ type: 'table',
1214
+ header: splitCells(cap[1]).map(function (c) {
1215
+ return {
1216
+ text: c
1217
+ };
1218
+ }),
1219
+ align: cap[2].replace(/^ *|\| *$/g, '').split(/ *\| */),
1220
+ rows: cap[3] && cap[3].trim() ? cap[3].replace(/\n[ \t]*$/, '').split('\n') : []
1221
+ };
1222
+
1223
+ if (item.header.length === item.align.length) {
1224
+ item.raw = cap[0];
1225
+ var l = item.align.length;
1226
+ var i, j, k, row;
1227
+
1228
+ for (i = 0; i < l; i++) {
1229
+ if (/^ *-+: *$/.test(item.align[i])) {
1230
+ item.align[i] = 'right';
1231
+ } else if (/^ *:-+: *$/.test(item.align[i])) {
1232
+ item.align[i] = 'center';
1233
+ } else if (/^ *:-+ *$/.test(item.align[i])) {
1234
+ item.align[i] = 'left';
1235
+ } else {
1236
+ item.align[i] = null;
1237
+ }
1238
+ }
1239
+
1240
+ l = item.rows.length;
1241
+
1242
+ for (i = 0; i < l; i++) {
1243
+ item.rows[i] = splitCells(item.rows[i], item.header.length).map(function (c) {
1244
+ return {
1245
+ text: c
1246
+ };
1247
+ });
1248
+ } // parse child tokens inside headers and cells
1249
+ // header child tokens
1250
+
1251
+
1252
+ l = item.header.length;
1253
+
1254
+ for (j = 0; j < l; j++) {
1255
+ item.header[j].tokens = this.lexer.inline(item.header[j].text);
1256
+ } // cell child tokens
1257
+
1258
+
1259
+ l = item.rows.length;
1260
+
1261
+ for (j = 0; j < l; j++) {
1262
+ row = item.rows[j];
1263
+
1264
+ for (k = 0; k < row.length; k++) {
1265
+ row[k].tokens = this.lexer.inline(row[k].text);
1266
+ }
1267
+ }
1268
+
1269
+ return item;
1270
+ }
1271
+ }
1272
+ };
1273
+
1274
+ _proto.lheading = function lheading(src) {
1275
+ var cap = this.rules.block.lheading.exec(src);
1276
+
1277
+ if (cap) {
1278
+ return {
1279
+ type: 'heading',
1280
+ raw: cap[0],
1281
+ depth: cap[2].charAt(0) === '=' ? 1 : 2,
1282
+ text: cap[1],
1283
+ tokens: this.lexer.inline(cap[1])
1284
+ };
1285
+ }
1286
+ };
1287
+
1288
+ _proto.paragraph = function paragraph(src) {
1289
+ var cap = this.rules.block.paragraph.exec(src);
1290
+
1291
+ if (cap) {
1292
+ var text = cap[1].charAt(cap[1].length - 1) === '\n' ? cap[1].slice(0, -1) : cap[1];
1293
+ return {
1294
+ type: 'paragraph',
1295
+ raw: cap[0],
1296
+ text: text,
1297
+ tokens: this.lexer.inline(text)
1298
+ };
1299
+ }
1300
+ };
1301
+
1302
+ _proto.text = function text(src) {
1303
+ var cap = this.rules.block.text.exec(src);
1304
+
1305
+ if (cap) {
1306
+ return {
1307
+ type: 'text',
1308
+ raw: cap[0],
1309
+ text: cap[0],
1310
+ tokens: this.lexer.inline(cap[0])
1311
+ };
1312
+ }
1313
+ };
1314
+
1315
+ _proto.escape = function escape$1(src) {
1316
+ var cap = this.rules.inline.escape.exec(src);
1317
+
1318
+ if (cap) {
1319
+ return {
1320
+ type: 'escape',
1321
+ raw: cap[0],
1322
+ text: escape(cap[1])
1323
+ };
1324
+ }
1325
+ };
1326
+
1327
+ _proto.tag = function tag(src) {
1328
+ var cap = this.rules.inline.tag.exec(src);
1329
+
1330
+ if (cap) {
1331
+ if (!this.lexer.state.inLink && /^<a /i.test(cap[0])) {
1332
+ this.lexer.state.inLink = true;
1333
+ } else if (this.lexer.state.inLink && /^<\/a>/i.test(cap[0])) {
1334
+ this.lexer.state.inLink = false;
1335
+ }
1336
+
1337
+ if (!this.lexer.state.inRawBlock && /^<(pre|code|kbd|script)(\s|>)/i.test(cap[0])) {
1338
+ this.lexer.state.inRawBlock = true;
1339
+ } else if (this.lexer.state.inRawBlock && /^<\/(pre|code|kbd|script)(\s|>)/i.test(cap[0])) {
1340
+ this.lexer.state.inRawBlock = false;
1341
+ }
1342
+
1343
+ return {
1344
+ type: this.options.sanitize ? 'text' : 'html',
1345
+ raw: cap[0],
1346
+ inLink: this.lexer.state.inLink,
1347
+ inRawBlock: this.lexer.state.inRawBlock,
1348
+ text: this.options.sanitize ? this.options.sanitizer ? this.options.sanitizer(cap[0]) : escape(cap[0]) : cap[0]
1349
+ };
1350
+ }
1351
+ };
1352
+
1353
+ _proto.link = function link(src) {
1354
+ var cap = this.rules.inline.link.exec(src);
1355
+
1356
+ if (cap) {
1357
+ var trimmedUrl = cap[2].trim();
1358
+
1359
+ if (!this.options.pedantic && /^</.test(trimmedUrl)) {
1360
+ // commonmark requires matching angle brackets
1361
+ if (!/>$/.test(trimmedUrl)) {
1362
+ return;
1363
+ } // ending angle bracket cannot be escaped
1364
+
1365
+
1366
+ var rtrimSlash = rtrim(trimmedUrl.slice(0, -1), '\\');
1367
+
1368
+ if ((trimmedUrl.length - rtrimSlash.length) % 2 === 0) {
1369
+ return;
1370
+ }
1371
+ } else {
1372
+ // find closing parenthesis
1373
+ var lastParenIndex = findClosingBracket(cap[2], '()');
1374
+
1375
+ if (lastParenIndex > -1) {
1376
+ var start = cap[0].indexOf('!') === 0 ? 5 : 4;
1377
+ var linkLen = start + cap[1].length + lastParenIndex;
1378
+ cap[2] = cap[2].substring(0, lastParenIndex);
1379
+ cap[0] = cap[0].substring(0, linkLen).trim();
1380
+ cap[3] = '';
1381
+ }
1382
+ }
1383
+
1384
+ var href = cap[2];
1385
+ var title = '';
1386
+
1387
+ if (this.options.pedantic) {
1388
+ // split pedantic href and title
1389
+ var link = /^([^'"]*[^\s])\s+(['"])(.*)\2/.exec(href);
1390
+
1391
+ if (link) {
1392
+ href = link[1];
1393
+ title = link[3];
1394
+ }
1395
+ } else {
1396
+ title = cap[3] ? cap[3].slice(1, -1) : '';
1397
+ }
1398
+
1399
+ href = href.trim();
1400
+
1401
+ if (/^</.test(href)) {
1402
+ if (this.options.pedantic && !/>$/.test(trimmedUrl)) {
1403
+ // pedantic allows starting angle bracket without ending angle bracket
1404
+ href = href.slice(1);
1405
+ } else {
1406
+ href = href.slice(1, -1);
1407
+ }
1408
+ }
1409
+
1410
+ return outputLink(cap, {
1411
+ href: href ? href.replace(this.rules.inline._escapes, '$1') : href,
1412
+ title: title ? title.replace(this.rules.inline._escapes, '$1') : title
1413
+ }, cap[0], this.lexer);
1414
+ }
1415
+ };
1416
+
1417
+ _proto.reflink = function reflink(src, links) {
1418
+ var cap;
1419
+
1420
+ if ((cap = this.rules.inline.reflink.exec(src)) || (cap = this.rules.inline.nolink.exec(src))) {
1421
+ var link = (cap[2] || cap[1]).replace(/\s+/g, ' ');
1422
+ link = links[link.toLowerCase()];
1423
+
1424
+ if (!link || !link.href) {
1425
+ var text = cap[0].charAt(0);
1426
+ return {
1427
+ type: 'text',
1428
+ raw: text,
1429
+ text: text
1430
+ };
1431
+ }
1432
+
1433
+ return outputLink(cap, link, cap[0], this.lexer);
1434
+ }
1435
+ };
1436
+
1437
+ _proto.emStrong = function emStrong(src, maskedSrc, prevChar) {
1438
+ if (prevChar === void 0) {
1439
+ prevChar = '';
1440
+ }
1441
+
1442
+ var match = this.rules.inline.emStrong.lDelim.exec(src);
1443
+ if (!match) return; // _ can't be between two alphanumerics. \p{L}\p{N} includes non-english alphabet/numbers as well
1444
+
1445
+ if (match[3] && prevChar.match(/(?:[0-9A-Za-z\xAA\xB2\xB3\xB5\xB9\xBA\xBC-\xBE\xC0-\xD6\xD8-\xF6\xF8-\u02C1\u02C6-\u02D1\u02E0-\u02E4\u02EC\u02EE\u0370-\u0374\u0376\u0377\u037A-\u037D\u037F\u0386\u0388-\u038A\u038C\u038E-\u03A1\u03A3-\u03F5\u03F7-\u0481\u048A-\u052F\u0531-\u0556\u0559\u0560-\u0588\u05D0-\u05EA\u05EF-\u05F2\u0620-\u064A\u0660-\u0669\u066E\u066F\u0671-\u06D3\u06D5\u06E5\u06E6\u06EE-\u06FC\u06FF\u0710\u0712-\u072F\u074D-\u07A5\u07B1\u07C0-\u07EA\u07F4\u07F5\u07FA\u0800-\u0815\u081A\u0824\u0828\u0840-\u0858\u0860-\u086A\u0870-\u0887\u0889-\u088E\u08A0-\u08C9\u0904-\u0939\u093D\u0950\u0958-\u0961\u0966-\u096F\u0971-\u0980\u0985-\u098C\u098F\u0990\u0993-\u09A8\u09AA-\u09B0\u09B2\u09B6-\u09B9\u09BD\u09CE\u09DC\u09DD\u09DF-\u09E1\u09E6-\u09F1\u09F4-\u09F9\u09FC\u0A05-\u0A0A\u0A0F\u0A10\u0A13-\u0A28\u0A2A-\u0A30\u0A32\u0A33\u0A35\u0A36\u0A38\u0A39\u0A59-\u0A5C\u0A5E\u0A66-\u0A6F\u0A72-\u0A74\u0A85-\u0A8D\u0A8F-\u0A91\u0A93-\u0AA8\u0AAA-\u0AB0\u0AB2\u0AB3\u0AB5-\u0AB9\u0ABD\u0AD0\u0AE0\u0AE1\u0AE6-\u0AEF\u0AF9\u0B05-\u0B0C\u0B0F\u0B10\u0B13-\u0B28\u0B2A-\u0B30\u0B32\u0B33\u0B35-\u0B39\u0B3D\u0B5C\u0B5D\u0B5F-\u0B61\u0B66-\u0B6F\u0B71-\u0B77\u0B83\u0B85-\u0B8A\u0B8E-\u0B90\u0B92-\u0B95\u0B99\u0B9A\u0B9C\u0B9E\u0B9F\u0BA3\u0BA4\u0BA8-\u0BAA\u0BAE-\u0BB9\u0BD0\u0BE6-\u0BF2\u0C05-\u0C0C\u0C0E-\u0C10\u0C12-\u0C28\u0C2A-\u0C39\u0C3D\u0C58-\u0C5A\u0C5D\u0C60\u0C61\u0C66-\u0C6F\u0C78-\u0C7E\u0C80\u0C85-\u0C8C\u0C8E-\u0C90\u0C92-\u0CA8\u0CAA-\u0CB3\u0CB5-\u0CB9\u0CBD\u0CDD\u0CDE\u0CE0\u0CE1\u0CE6-\u0CEF\u0CF1\u0CF2\u0D04-\u0D0C\u0D0E-\u0D10\u0D12-\u0D3A\u0D3D\u0D4E\u0D54-\u0D56\u0D58-\u0D61\u0D66-\u0D78\u0D7A-\u0D7F\u0D85-\u0D96\u0D9A-\u0DB1\u0DB3-\u0DBB\u0DBD\u0DC0-\u0DC6\u0DE6-\u0DEF\u0E01-\u0E30\u0E32\u0E33\u0E40-\u0E46\u0E50-\u0E59\u0E81\u0E82\u0E84\u0E86-\u0E8A\u0E8C-\u0EA3\u0EA5\u0EA7-\u0EB0\u0EB2\u0EB3\u0EBD\u0EC0-\u0EC4\u0EC6\u0ED0-\u0ED9\u0EDC-\u0EDF\u0F00\u0F20-\u0F33\u0F40-\u0F47\u0F49-\u0F6C\u0F88-\u0F8C\u1000-\u102A\u103F-\u1049\u1050-\u1055\u105A-\u105D\u1061\u1065\u1066\u106E-\u1070\u1075-\u1081\u108E\u1090-\u1099\u10A0-\u10C5\u10C7\u10CD\u10D0-\u10FA\u10FC-\u1248\u124A-\u124D\u1250-\u1256\u1258\u125A-\u125D\u1260-\u1288\u128A-\u128D\u1290-\u12B0\u12B2-\u12B5\u12B8-\u12BE\u12C0\u12C2-\u12C5\u12C8-\u12D6\u12D8-\u1310\u1312-\u1315\u1318-\u135A\u1369-\u137C\u1380-\u138F\u13A0-\u13F5\u13F8-\u13FD\u1401-\u166C\u166F-\u167F\u1681-\u169A\u16A0-\u16EA\u16EE-\u16F8\u1700-\u1711\u171F-\u1731\u1740-\u1751\u1760-\u176C\u176E-\u1770\u1780-\u17B3\u17D7\u17DC\u17E0-\u17E9\u17F0-\u17F9\u1810-\u1819\u1820-\u1878\u1880-\u1884\u1887-\u18A8\u18AA\u18B0-\u18F5\u1900-\u191E\u1946-\u196D\u1970-\u1974\u1980-\u19AB\u19B0-\u19C9\u19D0-\u19DA\u1A00-\u1A16\u1A20-\u1A54\u1A80-\u1A89\u1A90-\u1A99\u1AA7\u1B05-\u1B33\u1B45-\u1B4C\u1B50-\u1B59\u1B83-\u1BA0\u1BAE-\u1BE5\u1C00-\u1C23\u1C40-\u1C49\u1C4D-\u1C7D\u1C80-\u1C88\u1C90-\u1CBA\u1CBD-\u1CBF\u1CE9-\u1CEC\u1CEE-\u1CF3\u1CF5\u1CF6\u1CFA\u1D00-\u1DBF\u1E00-\u1F15\u1F18-\u1F1D\u1F20-\u1F45\u1F48-\u1F4D\u1F50-\u1F57\u1F59\u1F5B\u1F5D\u1F5F-\u1F7D\u1F80-\u1FB4\u1FB6-\u1FBC\u1FBE\u1FC2-\u1FC4\u1FC6-\u1FCC\u1FD0-\u1FD3\u1FD6-\u1FDB\u1FE0-\u1FEC\u1FF2-\u1FF4\u1FF6-\u1FFC\u2070\u2071\u2074-\u2079\u207F-\u2089\u2090-\u209C\u2102\u2107\u210A-\u2113\u2115\u2119-\u211D\u2124\u2126\u2128\u212A-\u212D\u212F-\u2139\u213C-\u213F\u2145-\u2149\u214E\u2150-\u2189\u2460-\u249B\u24EA-\u24FF\u2776-\u2793\u2C00-\u2CE4\u2CEB-\u2CEE\u2CF2\u2CF3\u2CFD\u2D00-\u2D25\u2D27\u2D2D\u2D30-\u2D67\u2D6F\u2D80-\u2D96\u2DA0-\u2DA6\u2DA8-\u2DAE\u2DB0-\u2DB6\u2DB8-\u2DBE\u2DC0-\u2DC6\u2DC8-\u2DCE\u2DD0-\u2DD6\u2DD8-\u2DDE\u2E2F\u3005-\u3007\u3021-\u3029\u3031-\u3035\u3038-\u303C\u3041-\u3096\u309D-\u309F\u30A1-\u30FA\u30FC-\u30FF\u3105-\u312F\u3131-\u318E\u3192-\u3195\u31A0-\u31BF\u31F0-\u31FF\u3220-\u3229\u3248-\u324F\u3251-\u325F\u3280-\u3289\u32B1-\u32BF\u3400-\u4DBF\u4E00-\uA48C\uA4D0-\uA4FD\uA500-\uA60C\uA610-\uA62B\uA640-\uA66E\uA67F-\uA69D\uA6A0-\uA6EF\uA717-\uA71F\uA722-\uA788\uA78B-\uA7CA\uA7D0\uA7D1\uA7D3\uA7D5-\uA7D9\uA7F2-\uA801\uA803-\uA805\uA807-\uA80A\uA80C-\uA822\uA830-\uA835\uA840-\uA873\uA882-\uA8B3\uA8D0-\uA8D9\uA8F2-\uA8F7\uA8FB\uA8FD\uA8FE\uA900-\uA925\uA930-\uA946\uA960-\uA97C\uA984-\uA9B2\uA9CF-\uA9D9\uA9E0-\uA9E4\uA9E6-\uA9FE\uAA00-\uAA28\uAA40-\uAA42\uAA44-\uAA4B\uAA50-\uAA59\uAA60-\uAA76\uAA7A\uAA7E-\uAAAF\uAAB1\uAAB5\uAAB6\uAAB9-\uAABD\uAAC0\uAAC2\uAADB-\uAADD\uAAE0-\uAAEA\uAAF2-\uAAF4\uAB01-\uAB06\uAB09-\uAB0E\uAB11-\uAB16\uAB20-\uAB26\uAB28-\uAB2E\uAB30-\uAB5A\uAB5C-\uAB69\uAB70-\uABE2\uABF0-\uABF9\uAC00-\uD7A3\uD7B0-\uD7C6\uD7CB-\uD7FB\uF900-\uFA6D\uFA70-\uFAD9\uFB00-\uFB06\uFB13-\uFB17\uFB1D\uFB1F-\uFB28\uFB2A-\uFB36\uFB38-\uFB3C\uFB3E\uFB40\uFB41\uFB43\uFB44\uFB46-\uFBB1\uFBD3-\uFD3D\uFD50-\uFD8F\uFD92-\uFDC7\uFDF0-\uFDFB\uFE70-\uFE74\uFE76-\uFEFC\uFF10-\uFF19\uFF21-\uFF3A\uFF41-\uFF5A\uFF66-\uFFBE\uFFC2-\uFFC7\uFFCA-\uFFCF\uFFD2-\uFFD7\uFFDA-\uFFDC]|\uD800[\uDC00-\uDC0B\uDC0D-\uDC26\uDC28-\uDC3A\uDC3C\uDC3D\uDC3F-\uDC4D\uDC50-\uDC5D\uDC80-\uDCFA\uDD07-\uDD33\uDD40-\uDD78\uDD8A\uDD8B\uDE80-\uDE9C\uDEA0-\uDED0\uDEE1-\uDEFB\uDF00-\uDF23\uDF2D-\uDF4A\uDF50-\uDF75\uDF80-\uDF9D\uDFA0-\uDFC3\uDFC8-\uDFCF\uDFD1-\uDFD5]|\uD801[\uDC00-\uDC9D\uDCA0-\uDCA9\uDCB0-\uDCD3\uDCD8-\uDCFB\uDD00-\uDD27\uDD30-\uDD63\uDD70-\uDD7A\uDD7C-\uDD8A\uDD8C-\uDD92\uDD94\uDD95\uDD97-\uDDA1\uDDA3-\uDDB1\uDDB3-\uDDB9\uDDBB\uDDBC\uDE00-\uDF36\uDF40-\uDF55\uDF60-\uDF67\uDF80-\uDF85\uDF87-\uDFB0\uDFB2-\uDFBA]|\uD802[\uDC00-\uDC05\uDC08\uDC0A-\uDC35\uDC37\uDC38\uDC3C\uDC3F-\uDC55\uDC58-\uDC76\uDC79-\uDC9E\uDCA7-\uDCAF\uDCE0-\uDCF2\uDCF4\uDCF5\uDCFB-\uDD1B\uDD20-\uDD39\uDD80-\uDDB7\uDDBC-\uDDCF\uDDD2-\uDE00\uDE10-\uDE13\uDE15-\uDE17\uDE19-\uDE35\uDE40-\uDE48\uDE60-\uDE7E\uDE80-\uDE9F\uDEC0-\uDEC7\uDEC9-\uDEE4\uDEEB-\uDEEF\uDF00-\uDF35\uDF40-\uDF55\uDF58-\uDF72\uDF78-\uDF91\uDFA9-\uDFAF]|\uD803[\uDC00-\uDC48\uDC80-\uDCB2\uDCC0-\uDCF2\uDCFA-\uDD23\uDD30-\uDD39\uDE60-\uDE7E\uDE80-\uDEA9\uDEB0\uDEB1\uDF00-\uDF27\uDF30-\uDF45\uDF51-\uDF54\uDF70-\uDF81\uDFB0-\uDFCB\uDFE0-\uDFF6]|\uD804[\uDC03-\uDC37\uDC52-\uDC6F\uDC71\uDC72\uDC75\uDC83-\uDCAF\uDCD0-\uDCE8\uDCF0-\uDCF9\uDD03-\uDD26\uDD36-\uDD3F\uDD44\uDD47\uDD50-\uDD72\uDD76\uDD83-\uDDB2\uDDC1-\uDDC4\uDDD0-\uDDDA\uDDDC\uDDE1-\uDDF4\uDE00-\uDE11\uDE13-\uDE2B\uDE80-\uDE86\uDE88\uDE8A-\uDE8D\uDE8F-\uDE9D\uDE9F-\uDEA8\uDEB0-\uDEDE\uDEF0-\uDEF9\uDF05-\uDF0C\uDF0F\uDF10\uDF13-\uDF28\uDF2A-\uDF30\uDF32\uDF33\uDF35-\uDF39\uDF3D\uDF50\uDF5D-\uDF61]|\uD805[\uDC00-\uDC34\uDC47-\uDC4A\uDC50-\uDC59\uDC5F-\uDC61\uDC80-\uDCAF\uDCC4\uDCC5\uDCC7\uDCD0-\uDCD9\uDD80-\uDDAE\uDDD8-\uDDDB\uDE00-\uDE2F\uDE44\uDE50-\uDE59\uDE80-\uDEAA\uDEB8\uDEC0-\uDEC9\uDF00-\uDF1A\uDF30-\uDF3B\uDF40-\uDF46]|\uD806[\uDC00-\uDC2B\uDCA0-\uDCF2\uDCFF-\uDD06\uDD09\uDD0C-\uDD13\uDD15\uDD16\uDD18-\uDD2F\uDD3F\uDD41\uDD50-\uDD59\uDDA0-\uDDA7\uDDAA-\uDDD0\uDDE1\uDDE3\uDE00\uDE0B-\uDE32\uDE3A\uDE50\uDE5C-\uDE89\uDE9D\uDEB0-\uDEF8]|\uD807[\uDC00-\uDC08\uDC0A-\uDC2E\uDC40\uDC50-\uDC6C\uDC72-\uDC8F\uDD00-\uDD06\uDD08\uDD09\uDD0B-\uDD30\uDD46\uDD50-\uDD59\uDD60-\uDD65\uDD67\uDD68\uDD6A-\uDD89\uDD98\uDDA0-\uDDA9\uDEE0-\uDEF2\uDFB0\uDFC0-\uDFD4]|\uD808[\uDC00-\uDF99]|\uD809[\uDC00-\uDC6E\uDC80-\uDD43]|\uD80B[\uDF90-\uDFF0]|[\uD80C\uD81C-\uD820\uD822\uD840-\uD868\uD86A-\uD86C\uD86F-\uD872\uD874-\uD879\uD880-\uD883][\uDC00-\uDFFF]|\uD80D[\uDC00-\uDC2E]|\uD811[\uDC00-\uDE46]|\uD81A[\uDC00-\uDE38\uDE40-\uDE5E\uDE60-\uDE69\uDE70-\uDEBE\uDEC0-\uDEC9\uDED0-\uDEED\uDF00-\uDF2F\uDF40-\uDF43\uDF50-\uDF59\uDF5B-\uDF61\uDF63-\uDF77\uDF7D-\uDF8F]|\uD81B[\uDE40-\uDE96\uDF00-\uDF4A\uDF50\uDF93-\uDF9F\uDFE0\uDFE1\uDFE3]|\uD821[\uDC00-\uDFF7]|\uD823[\uDC00-\uDCD5\uDD00-\uDD08]|\uD82B[\uDFF0-\uDFF3\uDFF5-\uDFFB\uDFFD\uDFFE]|\uD82C[\uDC00-\uDD22\uDD50-\uDD52\uDD64-\uDD67\uDD70-\uDEFB]|\uD82F[\uDC00-\uDC6A\uDC70-\uDC7C\uDC80-\uDC88\uDC90-\uDC99]|\uD834[\uDEE0-\uDEF3\uDF60-\uDF78]|\uD835[\uDC00-\uDC54\uDC56-\uDC9C\uDC9E\uDC9F\uDCA2\uDCA5\uDCA6\uDCA9-\uDCAC\uDCAE-\uDCB9\uDCBB\uDCBD-\uDCC3\uDCC5-\uDD05\uDD07-\uDD0A\uDD0D-\uDD14\uDD16-\uDD1C\uDD1E-\uDD39\uDD3B-\uDD3E\uDD40-\uDD44\uDD46\uDD4A-\uDD50\uDD52-\uDEA5\uDEA8-\uDEC0\uDEC2-\uDEDA\uDEDC-\uDEFA\uDEFC-\uDF14\uDF16-\uDF34\uDF36-\uDF4E\uDF50-\uDF6E\uDF70-\uDF88\uDF8A-\uDFA8\uDFAA-\uDFC2\uDFC4-\uDFCB\uDFCE-\uDFFF]|\uD837[\uDF00-\uDF1E]|\uD838[\uDD00-\uDD2C\uDD37-\uDD3D\uDD40-\uDD49\uDD4E\uDE90-\uDEAD\uDEC0-\uDEEB\uDEF0-\uDEF9]|\uD839[\uDFE0-\uDFE6\uDFE8-\uDFEB\uDFED\uDFEE\uDFF0-\uDFFE]|\uD83A[\uDC00-\uDCC4\uDCC7-\uDCCF\uDD00-\uDD43\uDD4B\uDD50-\uDD59]|\uD83B[\uDC71-\uDCAB\uDCAD-\uDCAF\uDCB1-\uDCB4\uDD01-\uDD2D\uDD2F-\uDD3D\uDE00-\uDE03\uDE05-\uDE1F\uDE21\uDE22\uDE24\uDE27\uDE29-\uDE32\uDE34-\uDE37\uDE39\uDE3B\uDE42\uDE47\uDE49\uDE4B\uDE4D-\uDE4F\uDE51\uDE52\uDE54\uDE57\uDE59\uDE5B\uDE5D\uDE5F\uDE61\uDE62\uDE64\uDE67-\uDE6A\uDE6C-\uDE72\uDE74-\uDE77\uDE79-\uDE7C\uDE7E\uDE80-\uDE89\uDE8B-\uDE9B\uDEA1-\uDEA3\uDEA5-\uDEA9\uDEAB-\uDEBB]|\uD83C[\uDD00-\uDD0C]|\uD83E[\uDFF0-\uDFF9]|\uD869[\uDC00-\uDEDF\uDF00-\uDFFF]|\uD86D[\uDC00-\uDF38\uDF40-\uDFFF]|\uD86E[\uDC00-\uDC1D\uDC20-\uDFFF]|\uD873[\uDC00-\uDEA1\uDEB0-\uDFFF]|\uD87A[\uDC00-\uDFE0]|\uD87E[\uDC00-\uDE1D]|\uD884[\uDC00-\uDF4A])/)) return;
1446
+ var nextChar = match[1] || match[2] || '';
1447
+
1448
+ if (!nextChar || nextChar && (prevChar === '' || this.rules.inline.punctuation.exec(prevChar))) {
1449
+ var lLength = match[0].length - 1;
1450
+ var rDelim,
1451
+ rLength,
1452
+ delimTotal = lLength,
1453
+ midDelimTotal = 0;
1454
+ var endReg = match[0][0] === '*' ? this.rules.inline.emStrong.rDelimAst : this.rules.inline.emStrong.rDelimUnd;
1455
+ endReg.lastIndex = 0; // Clip maskedSrc to same section of string as src (move to lexer?)
1456
+
1457
+ maskedSrc = maskedSrc.slice(-1 * src.length + lLength);
1458
+
1459
+ while ((match = endReg.exec(maskedSrc)) != null) {
1460
+ rDelim = match[1] || match[2] || match[3] || match[4] || match[5] || match[6];
1461
+ if (!rDelim) continue; // skip single * in __abc*abc__
1462
+
1463
+ rLength = rDelim.length;
1464
+
1465
+ if (match[3] || match[4]) {
1466
+ // found another Left Delim
1467
+ delimTotal += rLength;
1468
+ continue;
1469
+ } else if (match[5] || match[6]) {
1470
+ // either Left or Right Delim
1471
+ if (lLength % 3 && !((lLength + rLength) % 3)) {
1472
+ midDelimTotal += rLength;
1473
+ continue; // CommonMark Emphasis Rules 9-10
1474
+ }
1475
+ }
1476
+
1477
+ delimTotal -= rLength;
1478
+ if (delimTotal > 0) continue; // Haven't found enough closing delimiters
1479
+ // Remove extra characters. *a*** -> *a*
1480
+
1481
+ rLength = Math.min(rLength, rLength + delimTotal + midDelimTotal); // Create `em` if smallest delimiter has odd char count. *a***
1482
+
1483
+ if (Math.min(lLength, rLength) % 2) {
1484
+ var _text = src.slice(1, lLength + match.index + rLength);
1485
+
1486
+ return {
1487
+ type: 'em',
1488
+ raw: src.slice(0, lLength + match.index + rLength + 1),
1489
+ text: _text,
1490
+ tokens: this.lexer.inlineTokens(_text)
1491
+ };
1492
+ } // Create 'strong' if smallest delimiter has even char count. **a***
1493
+
1494
+
1495
+ var text = src.slice(2, lLength + match.index + rLength - 1);
1496
+ return {
1497
+ type: 'strong',
1498
+ raw: src.slice(0, lLength + match.index + rLength + 1),
1499
+ text: text,
1500
+ tokens: this.lexer.inlineTokens(text)
1501
+ };
1502
+ }
1503
+ }
1504
+ };
1505
+
1506
+ _proto.codespan = function codespan(src) {
1507
+ var cap = this.rules.inline.code.exec(src);
1508
+
1509
+ if (cap) {
1510
+ var text = cap[2].replace(/\n/g, ' ');
1511
+ var hasNonSpaceChars = /[^ ]/.test(text);
1512
+ var hasSpaceCharsOnBothEnds = /^ /.test(text) && / $/.test(text);
1513
+
1514
+ if (hasNonSpaceChars && hasSpaceCharsOnBothEnds) {
1515
+ text = text.substring(1, text.length - 1);
1516
+ }
1517
+
1518
+ text = escape(text, true);
1519
+ return {
1520
+ type: 'codespan',
1521
+ raw: cap[0],
1522
+ text: text
1523
+ };
1524
+ }
1525
+ };
1526
+
1527
+ _proto.br = function br(src) {
1528
+ var cap = this.rules.inline.br.exec(src);
1529
+
1530
+ if (cap) {
1531
+ return {
1532
+ type: 'br',
1533
+ raw: cap[0]
1534
+ };
1535
+ }
1536
+ };
1537
+
1538
+ _proto.del = function del(src) {
1539
+ var cap = this.rules.inline.del.exec(src);
1540
+
1541
+ if (cap) {
1542
+ return {
1543
+ type: 'del',
1544
+ raw: cap[0],
1545
+ text: cap[2],
1546
+ tokens: this.lexer.inlineTokens(cap[2])
1547
+ };
1548
+ }
1549
+ };
1550
+
1551
+ _proto.autolink = function autolink(src, mangle) {
1552
+ var cap = this.rules.inline.autolink.exec(src);
1553
+
1554
+ if (cap) {
1555
+ var text, href;
1556
+
1557
+ if (cap[2] === '@') {
1558
+ text = escape(this.options.mangle ? mangle(cap[1]) : cap[1]);
1559
+ href = 'mailto:' + text;
1560
+ } else {
1561
+ text = escape(cap[1]);
1562
+ href = text;
1563
+ }
1564
+
1565
+ return {
1566
+ type: 'link',
1567
+ raw: cap[0],
1568
+ text: text,
1569
+ href: href,
1570
+ tokens: [{
1571
+ type: 'text',
1572
+ raw: text,
1573
+ text: text
1574
+ }]
1575
+ };
1576
+ }
1577
+ };
1578
+
1579
+ _proto.url = function url(src, mangle) {
1580
+ var cap;
1581
+
1582
+ if (cap = this.rules.inline.url.exec(src)) {
1583
+ var text, href;
1584
+
1585
+ if (cap[2] === '@') {
1586
+ text = escape(this.options.mangle ? mangle(cap[0]) : cap[0]);
1587
+ href = 'mailto:' + text;
1588
+ } else {
1589
+ // do extended autolink path validation
1590
+ var prevCapZero;
1591
+
1592
+ do {
1593
+ prevCapZero = cap[0];
1594
+ cap[0] = this.rules.inline._backpedal.exec(cap[0])[0];
1595
+ } while (prevCapZero !== cap[0]);
1596
+
1597
+ text = escape(cap[0]);
1598
+
1599
+ if (cap[1] === 'www.') {
1600
+ href = 'http://' + text;
1601
+ } else {
1602
+ href = text;
1603
+ }
1604
+ }
1605
+
1606
+ return {
1607
+ type: 'link',
1608
+ raw: cap[0],
1609
+ text: text,
1610
+ href: href,
1611
+ tokens: [{
1612
+ type: 'text',
1613
+ raw: text,
1614
+ text: text
1615
+ }]
1616
+ };
1617
+ }
1618
+ };
1619
+
1620
+ _proto.inlineText = function inlineText(src, smartypants) {
1621
+ var cap = this.rules.inline.text.exec(src);
1622
+
1623
+ if (cap) {
1624
+ var text;
1625
+
1626
+ if (this.lexer.state.inRawBlock) {
1627
+ text = this.options.sanitize ? this.options.sanitizer ? this.options.sanitizer(cap[0]) : escape(cap[0]) : cap[0];
1628
+ } else {
1629
+ text = escape(this.options.smartypants ? smartypants(cap[0]) : cap[0]);
1630
+ }
1631
+
1632
+ return {
1633
+ type: 'text',
1634
+ raw: cap[0],
1635
+ text: text
1636
+ };
1637
+ }
1638
+ };
1639
+
1640
+ return Tokenizer;
1641
+ }();
1642
+
1643
+ /**
1644
+ * Block-Level Grammar
1645
+ */
1646
+
1647
+ var block = {
1648
+ newline: /^(?: *(?:\n|$))+/,
1649
+ code: /^( {4}[^\n]+(?:\n(?: *(?:\n|$))*)?)+/,
1650
+ fences: /^ {0,3}(`{3,}(?=[^`\n]*\n)|~{3,})([^\n]*)\n(?:|([\s\S]*?)\n)(?: {0,3}\1[~`]* *(?=\n|$)|$)/,
1651
+ hr: /^ {0,3}((?:-[\t ]*){3,}|(?:_[ \t]*){3,}|(?:\*[ \t]*){3,})(?:\n+|$)/,
1652
+ heading: /^ {0,3}(#{1,6})(?=\s|$)(.*)(?:\n+|$)/,
1653
+ blockquote: /^( {0,3}> ?(paragraph|[^\n]*)(?:\n|$))+/,
1654
+ list: /^( {0,3}bull)([ \t][^\n]+?)?(?:\n|$)/,
1655
+ html: '^ {0,3}(?:' // optional indentation
1656
+ + '<(script|pre|style|textarea)[\\s>][\\s\\S]*?(?:</\\1>[^\\n]*\\n+|$)' // (1)
1657
+ + '|comment[^\\n]*(\\n+|$)' // (2)
1658
+ + '|<\\?[\\s\\S]*?(?:\\?>\\n*|$)' // (3)
1659
+ + '|<![A-Z][\\s\\S]*?(?:>\\n*|$)' // (4)
1660
+ + '|<!\\[CDATA\\[[\\s\\S]*?(?:\\]\\]>\\n*|$)' // (5)
1661
+ + '|</?(tag)(?: +|\\n|/?>)[\\s\\S]*?(?:(?:\\n *)+\\n|$)' // (6)
1662
+ + '|<(?!script|pre|style|textarea)([a-z][\\w-]*)(?:attribute)*? */?>(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:(?:\\n *)+\\n|$)' // (7) open tag
1663
+ + '|</(?!script|pre|style|textarea)[a-z][\\w-]*\\s*>(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:(?:\\n *)+\\n|$)' // (7) closing tag
1664
+ + ')',
1665
+ def: /^ {0,3}\[(label)\]: *(?:\n *)?<?([^\s>]+)>?(?:(?: +(?:\n *)?| *\n *)(title))? *(?:\n+|$)/,
1666
+ table: noopTest,
1667
+ lheading: /^([^\n]+)\n {0,3}(=+|-+) *(?:\n+|$)/,
1668
+ // regex template, placeholders will be replaced according to different paragraph
1669
+ // interruption rules of commonmark and the original markdown spec:
1670
+ _paragraph: /^([^\n]+(?:\n(?!hr|heading|lheading|blockquote|fences|list|html|table| +\n)[^\n]+)*)/,
1671
+ text: /^[^\n]+/
1672
+ };
1673
+ block._label = /(?!\s*\])(?:\\.|[^\[\]\\])+/;
1674
+ block._title = /(?:"(?:\\"?|[^"\\])*"|'[^'\n]*(?:\n[^'\n]+)*\n?'|\([^()]*\))/;
1675
+ block.def = edit(block.def).replace('label', block._label).replace('title', block._title).getRegex();
1676
+ block.bullet = /(?:[*+-]|\d{1,9}[.)])/;
1677
+ block.listItemStart = edit(/^( *)(bull) */).replace('bull', block.bullet).getRegex();
1678
+ block.list = edit(block.list).replace(/bull/g, block.bullet).replace('hr', '\\n+(?=\\1?(?:(?:- *){3,}|(?:_ *){3,}|(?:\\* *){3,})(?:\\n+|$))').replace('def', '\\n+(?=' + block.def.source + ')').getRegex();
1679
+ block._tag = 'address|article|aside|base|basefont|blockquote|body|caption' + '|center|col|colgroup|dd|details|dialog|dir|div|dl|dt|fieldset|figcaption' + '|figure|footer|form|frame|frameset|h[1-6]|head|header|hr|html|iframe' + '|legend|li|link|main|menu|menuitem|meta|nav|noframes|ol|optgroup|option' + '|p|param|section|source|summary|table|tbody|td|tfoot|th|thead|title|tr' + '|track|ul';
1680
+ block._comment = /<!--(?!-?>)[\s\S]*?(?:-->|$)/;
1681
+ block.html = edit(block.html, 'i').replace('comment', block._comment).replace('tag', block._tag).replace('attribute', / +[a-zA-Z:_][\w.:-]*(?: *= *"[^"\n]*"| *= *'[^'\n]*'| *= *[^\s"'=<>`]+)?/).getRegex();
1682
+ block.paragraph = edit(block._paragraph).replace('hr', block.hr).replace('heading', ' {0,3}#{1,6} ').replace('|lheading', '') // setex headings don't interrupt commonmark paragraphs
1683
+ .replace('|table', '').replace('blockquote', ' {0,3}>').replace('fences', ' {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n').replace('list', ' {0,3}(?:[*+-]|1[.)]) ') // only lists starting from 1 can interrupt
1684
+ .replace('html', '</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)').replace('tag', block._tag) // pars can be interrupted by type (6) html blocks
1685
+ .getRegex();
1686
+ block.blockquote = edit(block.blockquote).replace('paragraph', block.paragraph).getRegex();
1687
+ /**
1688
+ * Normal Block Grammar
1689
+ */
1690
+
1691
+ block.normal = merge({}, block);
1692
+ /**
1693
+ * GFM Block Grammar
1694
+ */
1695
+
1696
+ block.gfm = merge({}, block.normal, {
1697
+ table: '^ *([^\\n ].*\\|.*)\\n' // Header
1698
+ + ' {0,3}(?:\\| *)?(:?-+:? *(?:\\| *:?-+:? *)*)(?:\\| *)?' // Align
1699
+ + '(?:\\n((?:(?! *\\n|hr|heading|blockquote|code|fences|list|html).*(?:\\n|$))*)\\n*|$)' // Cells
1700
+
1701
+ });
1702
+ block.gfm.table = edit(block.gfm.table).replace('hr', block.hr).replace('heading', ' {0,3}#{1,6} ').replace('blockquote', ' {0,3}>').replace('code', ' {4}[^\\n]').replace('fences', ' {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n').replace('list', ' {0,3}(?:[*+-]|1[.)]) ') // only lists starting from 1 can interrupt
1703
+ .replace('html', '</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)').replace('tag', block._tag) // tables can be interrupted by type (6) html blocks
1704
+ .getRegex();
1705
+ block.gfm.paragraph = edit(block._paragraph).replace('hr', block.hr).replace('heading', ' {0,3}#{1,6} ').replace('|lheading', '') // setex headings don't interrupt commonmark paragraphs
1706
+ .replace('table', block.gfm.table) // interrupt paragraphs with table
1707
+ .replace('blockquote', ' {0,3}>').replace('fences', ' {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n').replace('list', ' {0,3}(?:[*+-]|1[.)]) ') // only lists starting from 1 can interrupt
1708
+ .replace('html', '</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)').replace('tag', block._tag) // pars can be interrupted by type (6) html blocks
1709
+ .getRegex();
1710
+ /**
1711
+ * Pedantic grammar (original John Gruber's loose markdown specification)
1712
+ */
1713
+
1714
+ block.pedantic = merge({}, block.normal, {
1715
+ html: edit('^ *(?:comment *(?:\\n|\\s*$)' + '|<(tag)[\\s\\S]+?</\\1> *(?:\\n{2,}|\\s*$)' // closed tag
1716
+ + '|<tag(?:"[^"]*"|\'[^\']*\'|\\s[^\'"/>\\s]*)*?/?> *(?:\\n{2,}|\\s*$))').replace('comment', block._comment).replace(/tag/g, '(?!(?:' + 'a|em|strong|small|s|cite|q|dfn|abbr|data|time|code|var|samp|kbd|sub' + '|sup|i|b|u|mark|ruby|rt|rp|bdi|bdo|span|br|wbr|ins|del|img)' + '\\b)\\w+(?!:|[^\\w\\s@]*@)\\b').getRegex(),
1717
+ def: /^ *\[([^\]]+)\]: *<?([^\s>]+)>?(?: +(["(][^\n]+[")]))? *(?:\n+|$)/,
1718
+ heading: /^(#{1,6})(.*)(?:\n+|$)/,
1719
+ fences: noopTest,
1720
+ // fences not supported
1721
+ paragraph: edit(block.normal._paragraph).replace('hr', block.hr).replace('heading', ' *#{1,6} *[^\n]').replace('lheading', block.lheading).replace('blockquote', ' {0,3}>').replace('|fences', '').replace('|list', '').replace('|html', '').getRegex()
1722
+ });
1723
+ /**
1724
+ * Inline-Level Grammar
1725
+ */
1726
+
1727
+ var inline = {
1728
+ escape: /^\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/,
1729
+ autolink: /^<(scheme:[^\s\x00-\x1f<>]*|email)>/,
1730
+ url: noopTest,
1731
+ tag: '^comment' + '|^</[a-zA-Z][\\w:-]*\\s*>' // self-closing tag
1732
+ + '|^<[a-zA-Z][\\w-]*(?:attribute)*?\\s*/?>' // open tag
1733
+ + '|^<\\?[\\s\\S]*?\\?>' // processing instruction, e.g. <?php ?>
1734
+ + '|^<![a-zA-Z]+\\s[\\s\\S]*?>' // declaration, e.g. <!DOCTYPE html>
1735
+ + '|^<!\\[CDATA\\[[\\s\\S]*?\\]\\]>',
1736
+ // CDATA section
1737
+ link: /^!?\[(label)\]\(\s*(href)(?:\s+(title))?\s*\)/,
1738
+ reflink: /^!?\[(label)\]\[(ref)\]/,
1739
+ nolink: /^!?\[(ref)\](?:\[\])?/,
1740
+ reflinkSearch: 'reflink|nolink(?!\\()',
1741
+ emStrong: {
1742
+ lDelim: /^(?:\*+(?:([punct_])|[^\s*]))|^_+(?:([punct*])|([^\s_]))/,
1743
+ // (1) and (2) can only be a Right Delimiter. (3) and (4) can only be Left. (5) and (6) can be either Left or Right.
1744
+ // () Skip orphan inside strong () Consume to delim (1) #*** (2) a***#, a*** (3) #***a, ***a (4) ***# (5) #***# (6) a***a
1745
+ rDelimAst: /^[^_*]*?\_\_[^_*]*?\*[^_*]*?(?=\_\_)|[^*]+(?=[^*])|[punct_](\*+)(?=[\s]|$)|[^punct*_\s](\*+)(?=[punct_\s]|$)|[punct_\s](\*+)(?=[^punct*_\s])|[\s](\*+)(?=[punct_])|[punct_](\*+)(?=[punct_])|[^punct*_\s](\*+)(?=[^punct*_\s])/,
1746
+ rDelimUnd: /^[^_*]*?\*\*[^_*]*?\_[^_*]*?(?=\*\*)|[^_]+(?=[^_])|[punct*](\_+)(?=[\s]|$)|[^punct*_\s](\_+)(?=[punct*\s]|$)|[punct*\s](\_+)(?=[^punct*_\s])|[\s](\_+)(?=[punct*])|[punct*](\_+)(?=[punct*])/ // ^- Not allowed for _
1747
+
1748
+ },
1749
+ code: /^(`+)([^`]|[^`][\s\S]*?[^`])\1(?!`)/,
1750
+ br: /^( {2,}|\\)\n(?!\s*$)/,
1751
+ del: noopTest,
1752
+ text: /^(`+|[^`])(?:(?= {2,}\n)|[\s\S]*?(?:(?=[\\<!\[`*_]|\b_|$)|[^ ](?= {2,}\n)))/,
1753
+ punctuation: /^([\spunctuation])/
1754
+ }; // list of punctuation marks from CommonMark spec
1755
+ // without * and _ to handle the different emphasis markers * and _
1756
+
1757
+ inline._punctuation = '!"#$%&\'()+\\-.,/:;<=>?@\\[\\]`^{|}~';
1758
+ inline.punctuation = edit(inline.punctuation).replace(/punctuation/g, inline._punctuation).getRegex(); // sequences em should skip over [title](link), `code`, <html>
1759
+
1760
+ inline.blockSkip = /\[[^\]]*?\]\([^\)]*?\)|`[^`]*?`|<[^>]*?>/g;
1761
+ inline.escapedEmSt = /\\\*|\\_/g;
1762
+ inline._comment = edit(block._comment).replace('(?:-->|$)', '-->').getRegex();
1763
+ inline.emStrong.lDelim = edit(inline.emStrong.lDelim).replace(/punct/g, inline._punctuation).getRegex();
1764
+ inline.emStrong.rDelimAst = edit(inline.emStrong.rDelimAst, 'g').replace(/punct/g, inline._punctuation).getRegex();
1765
+ inline.emStrong.rDelimUnd = edit(inline.emStrong.rDelimUnd, 'g').replace(/punct/g, inline._punctuation).getRegex();
1766
+ inline._escapes = /\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/g;
1767
+ inline._scheme = /[a-zA-Z][a-zA-Z0-9+.-]{1,31}/;
1768
+ inline._email = /[a-zA-Z0-9.!#$%&'*+/=?^_`{|}~-]+(@)[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)+(?![-_])/;
1769
+ inline.autolink = edit(inline.autolink).replace('scheme', inline._scheme).replace('email', inline._email).getRegex();
1770
+ inline._attribute = /\s+[a-zA-Z:_][\w.:-]*(?:\s*=\s*"[^"]*"|\s*=\s*'[^']*'|\s*=\s*[^\s"'=<>`]+)?/;
1771
+ inline.tag = edit(inline.tag).replace('comment', inline._comment).replace('attribute', inline._attribute).getRegex();
1772
+ inline._label = /(?:\[(?:\\.|[^\[\]\\])*\]|\\.|`[^`]*`|[^\[\]\\`])*?/;
1773
+ inline._href = /<(?:\\.|[^\n<>\\])+>|[^\s\x00-\x1f]*/;
1774
+ inline._title = /"(?:\\"?|[^"\\])*"|'(?:\\'?|[^'\\])*'|\((?:\\\)?|[^)\\])*\)/;
1775
+ inline.link = edit(inline.link).replace('label', inline._label).replace('href', inline._href).replace('title', inline._title).getRegex();
1776
+ inline.reflink = edit(inline.reflink).replace('label', inline._label).replace('ref', block._label).getRegex();
1777
+ inline.nolink = edit(inline.nolink).replace('ref', block._label).getRegex();
1778
+ inline.reflinkSearch = edit(inline.reflinkSearch, 'g').replace('reflink', inline.reflink).replace('nolink', inline.nolink).getRegex();
1779
+ /**
1780
+ * Normal Inline Grammar
1781
+ */
1782
+
1783
+ inline.normal = merge({}, inline);
1784
+ /**
1785
+ * Pedantic Inline Grammar
1786
+ */
1787
+
1788
+ inline.pedantic = merge({}, inline.normal, {
1789
+ strong: {
1790
+ start: /^__|\*\*/,
1791
+ middle: /^__(?=\S)([\s\S]*?\S)__(?!_)|^\*\*(?=\S)([\s\S]*?\S)\*\*(?!\*)/,
1792
+ endAst: /\*\*(?!\*)/g,
1793
+ endUnd: /__(?!_)/g
1794
+ },
1795
+ em: {
1796
+ start: /^_|\*/,
1797
+ middle: /^()\*(?=\S)([\s\S]*?\S)\*(?!\*)|^_(?=\S)([\s\S]*?\S)_(?!_)/,
1798
+ endAst: /\*(?!\*)/g,
1799
+ endUnd: /_(?!_)/g
1800
+ },
1801
+ link: edit(/^!?\[(label)\]\((.*?)\)/).replace('label', inline._label).getRegex(),
1802
+ reflink: edit(/^!?\[(label)\]\s*\[([^\]]*)\]/).replace('label', inline._label).getRegex()
1803
+ });
1804
+ /**
1805
+ * GFM Inline Grammar
1806
+ */
1807
+
1808
+ inline.gfm = merge({}, inline.normal, {
1809
+ escape: edit(inline.escape).replace('])', '~|])').getRegex(),
1810
+ _extended_email: /[A-Za-z0-9._+-]+(@)[a-zA-Z0-9-_]+(?:\.[a-zA-Z0-9-_]*[a-zA-Z0-9])+(?![-_])/,
1811
+ url: /^((?:ftp|https?):\/\/|www\.)(?:[a-zA-Z0-9\-]+\.?)+[^\s<]*|^email/,
1812
+ _backpedal: /(?:[^?!.,:;*_~()&]+|\([^)]*\)|&(?![a-zA-Z0-9]+;$)|[?!.,:;*_~)]+(?!$))+/,
1813
+ del: /^(~~?)(?=[^\s~])([\s\S]*?[^\s~])\1(?=[^~]|$)/,
1814
+ text: /^([`~]+|[^`~])(?:(?= {2,}\n)|(?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@)|[\s\S]*?(?:(?=[\\<!\[`*~_]|\b_|https?:\/\/|ftp:\/\/|www\.|$)|[^ ](?= {2,}\n)|[^a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-](?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@)))/
1815
+ });
1816
+ inline.gfm.url = edit(inline.gfm.url, 'i').replace('email', inline.gfm._extended_email).getRegex();
1817
+ /**
1818
+ * GFM + Line Breaks Inline Grammar
1819
+ */
1820
+
1821
+ inline.breaks = merge({}, inline.gfm, {
1822
+ br: edit(inline.br).replace('{2,}', '*').getRegex(),
1823
+ text: edit(inline.gfm.text).replace('\\b_', '\\b_| {2,}\\n').replace(/\{2,\}/g, '*').getRegex()
1824
+ });
1825
+
1826
+ /**
1827
+ * smartypants text replacement
1828
+ * @param {string} text
1829
+ */
1830
+
1831
+ function smartypants(text) {
1832
+ return text // em-dashes
1833
+ .replace(/---/g, "\u2014") // en-dashes
1834
+ .replace(/--/g, "\u2013") // opening singles
1835
+ .replace(/(^|[-\u2014/(\[{"\s])'/g, "$1\u2018") // closing singles & apostrophes
1836
+ .replace(/'/g, "\u2019") // opening doubles
1837
+ .replace(/(^|[-\u2014/(\[{\u2018\s])"/g, "$1\u201C") // closing doubles
1838
+ .replace(/"/g, "\u201D") // ellipses
1839
+ .replace(/\.{3}/g, "\u2026");
1840
+ }
1841
+ /**
1842
+ * mangle email addresses
1843
+ * @param {string} text
1844
+ */
1845
+
1846
+
1847
+ function mangle(text) {
1848
+ var out = '',
1849
+ i,
1850
+ ch;
1851
+ var l = text.length;
1852
+
1853
+ for (i = 0; i < l; i++) {
1854
+ ch = text.charCodeAt(i);
1855
+
1856
+ if (Math.random() > 0.5) {
1857
+ ch = 'x' + ch.toString(16);
1858
+ }
1859
+
1860
+ out += '&#' + ch + ';';
1861
+ }
1862
+
1863
+ return out;
1864
+ }
1865
+ /**
1866
+ * Block Lexer
1867
+ */
1868
+
1869
+
1870
+ var Lexer = /*#__PURE__*/function () {
1871
+ function Lexer(options) {
1872
+ this.tokens = [];
1873
+ this.tokens.links = Object.create(null);
1874
+ this.options = options || exports.defaults;
1875
+ this.options.tokenizer = this.options.tokenizer || new Tokenizer();
1876
+ this.tokenizer = this.options.tokenizer;
1877
+ this.tokenizer.options = this.options;
1878
+ this.tokenizer.lexer = this;
1879
+ this.inlineQueue = [];
1880
+ this.state = {
1881
+ inLink: false,
1882
+ inRawBlock: false,
1883
+ top: true
1884
+ };
1885
+ var rules = {
1886
+ block: block.normal,
1887
+ inline: inline.normal
1888
+ };
1889
+
1890
+ if (this.options.pedantic) {
1891
+ rules.block = block.pedantic;
1892
+ rules.inline = inline.pedantic;
1893
+ } else if (this.options.gfm) {
1894
+ rules.block = block.gfm;
1895
+
1896
+ if (this.options.breaks) {
1897
+ rules.inline = inline.breaks;
1898
+ } else {
1899
+ rules.inline = inline.gfm;
1900
+ }
1901
+ }
1902
+
1903
+ this.tokenizer.rules = rules;
1904
+ }
1905
+ /**
1906
+ * Expose Rules
1907
+ */
1908
+
1909
+
1910
+ /**
1911
+ * Static Lex Method
1912
+ */
1913
+ Lexer.lex = function lex(src, options) {
1914
+ var lexer = new Lexer(options);
1915
+ return lexer.lex(src);
1916
+ }
1917
+ /**
1918
+ * Static Lex Inline Method
1919
+ */
1920
+ ;
1921
+
1922
+ Lexer.lexInline = function lexInline(src, options) {
1923
+ var lexer = new Lexer(options);
1924
+ return lexer.inlineTokens(src);
1925
+ }
1926
+ /**
1927
+ * Preprocessing
1928
+ */
1929
+ ;
1930
+
1931
+ var _proto = Lexer.prototype;
1932
+
1933
+ _proto.lex = function lex(src) {
1934
+ src = src.replace(/\r\n|\r/g, '\n');
1935
+ this.blockTokens(src, this.tokens);
1936
+ var next;
1937
+
1938
+ while (next = this.inlineQueue.shift()) {
1939
+ this.inlineTokens(next.src, next.tokens);
1940
+ }
1941
+
1942
+ return this.tokens;
1943
+ }
1944
+ /**
1945
+ * Lexing
1946
+ */
1947
+ ;
1948
+
1949
+ _proto.blockTokens = function blockTokens(src, tokens) {
1950
+ var _this = this;
1951
+
1952
+ if (tokens === void 0) {
1953
+ tokens = [];
1954
+ }
1955
+
1956
+ if (this.options.pedantic) {
1957
+ src = src.replace(/\t/g, ' ').replace(/^ +$/gm, '');
1958
+ } else {
1959
+ src = src.replace(/^( *)(\t+)/gm, function (_, leading, tabs) {
1960
+ return leading + ' '.repeat(tabs.length);
1961
+ });
1962
+ }
1963
+
1964
+ var token, lastToken, cutSrc, lastParagraphClipped;
1965
+
1966
+ while (src) {
1967
+ if (this.options.extensions && this.options.extensions.block && this.options.extensions.block.some(function (extTokenizer) {
1968
+ if (token = extTokenizer.call({
1969
+ lexer: _this
1970
+ }, src, tokens)) {
1971
+ src = src.substring(token.raw.length);
1972
+ tokens.push(token);
1973
+ return true;
1974
+ }
1975
+
1976
+ return false;
1977
+ })) {
1978
+ continue;
1979
+ } // newline
1980
+
1981
+
1982
+ if (token = this.tokenizer.space(src)) {
1983
+ src = src.substring(token.raw.length);
1984
+
1985
+ if (token.raw.length === 1 && tokens.length > 0) {
1986
+ // if there's a single \n as a spacer, it's terminating the last line,
1987
+ // so move it there so that we don't get unecessary paragraph tags
1988
+ tokens[tokens.length - 1].raw += '\n';
1989
+ } else {
1990
+ tokens.push(token);
1991
+ }
1992
+
1993
+ continue;
1994
+ } // code
1995
+
1996
+
1997
+ if (token = this.tokenizer.code(src)) {
1998
+ src = src.substring(token.raw.length);
1999
+ lastToken = tokens[tokens.length - 1]; // An indented code block cannot interrupt a paragraph.
2000
+
2001
+ if (lastToken && (lastToken.type === 'paragraph' || lastToken.type === 'text')) {
2002
+ lastToken.raw += '\n' + token.raw;
2003
+ lastToken.text += '\n' + token.text;
2004
+ this.inlineQueue[this.inlineQueue.length - 1].src = lastToken.text;
2005
+ } else {
2006
+ tokens.push(token);
2007
+ }
2008
+
2009
+ continue;
2010
+ } // fences
2011
+
2012
+
2013
+ if (token = this.tokenizer.fences(src)) {
2014
+ src = src.substring(token.raw.length);
2015
+ tokens.push(token);
2016
+ continue;
2017
+ } // heading
2018
+
2019
+
2020
+ if (token = this.tokenizer.heading(src)) {
2021
+ src = src.substring(token.raw.length);
2022
+ tokens.push(token);
2023
+ continue;
2024
+ } // hr
2025
+
2026
+
2027
+ if (token = this.tokenizer.hr(src)) {
2028
+ src = src.substring(token.raw.length);
2029
+ tokens.push(token);
2030
+ continue;
2031
+ } // blockquote
2032
+
2033
+
2034
+ if (token = this.tokenizer.blockquote(src)) {
2035
+ src = src.substring(token.raw.length);
2036
+ tokens.push(token);
2037
+ continue;
2038
+ } // list
2039
+
2040
+
2041
+ if (token = this.tokenizer.list(src)) {
2042
+ src = src.substring(token.raw.length);
2043
+ tokens.push(token);
2044
+ continue;
2045
+ } // html
2046
+
2047
+
2048
+ if (token = this.tokenizer.html(src)) {
2049
+ src = src.substring(token.raw.length);
2050
+ tokens.push(token);
2051
+ continue;
2052
+ } // def
2053
+
2054
+
2055
+ if (token = this.tokenizer.def(src)) {
2056
+ src = src.substring(token.raw.length);
2057
+ lastToken = tokens[tokens.length - 1];
2058
+
2059
+ if (lastToken && (lastToken.type === 'paragraph' || lastToken.type === 'text')) {
2060
+ lastToken.raw += '\n' + token.raw;
2061
+ lastToken.text += '\n' + token.raw;
2062
+ this.inlineQueue[this.inlineQueue.length - 1].src = lastToken.text;
2063
+ } else if (!this.tokens.links[token.tag]) {
2064
+ this.tokens.links[token.tag] = {
2065
+ href: token.href,
2066
+ title: token.title
2067
+ };
2068
+ }
2069
+
2070
+ continue;
2071
+ } // table (gfm)
2072
+
2073
+
2074
+ if (token = this.tokenizer.table(src)) {
2075
+ src = src.substring(token.raw.length);
2076
+ tokens.push(token);
2077
+ continue;
2078
+ } // lheading
2079
+
2080
+
2081
+ if (token = this.tokenizer.lheading(src)) {
2082
+ src = src.substring(token.raw.length);
2083
+ tokens.push(token);
2084
+ continue;
2085
+ } // top-level paragraph
2086
+ // prevent paragraph consuming extensions by clipping 'src' to extension start
2087
+
2088
+
2089
+ cutSrc = src;
2090
+
2091
+ if (this.options.extensions && this.options.extensions.startBlock) {
2092
+ (function () {
2093
+ var startIndex = Infinity;
2094
+ var tempSrc = src.slice(1);
2095
+ var tempStart = void 0;
2096
+
2097
+ _this.options.extensions.startBlock.forEach(function (getStartIndex) {
2098
+ tempStart = getStartIndex.call({
2099
+ lexer: this
2100
+ }, tempSrc);
2101
+
2102
+ if (typeof tempStart === 'number' && tempStart >= 0) {
2103
+ startIndex = Math.min(startIndex, tempStart);
2104
+ }
2105
+ });
2106
+
2107
+ if (startIndex < Infinity && startIndex >= 0) {
2108
+ cutSrc = src.substring(0, startIndex + 1);
2109
+ }
2110
+ })();
2111
+ }
2112
+
2113
+ if (this.state.top && (token = this.tokenizer.paragraph(cutSrc))) {
2114
+ lastToken = tokens[tokens.length - 1];
2115
+
2116
+ if (lastParagraphClipped && lastToken.type === 'paragraph') {
2117
+ lastToken.raw += '\n' + token.raw;
2118
+ lastToken.text += '\n' + token.text;
2119
+ this.inlineQueue.pop();
2120
+ this.inlineQueue[this.inlineQueue.length - 1].src = lastToken.text;
2121
+ } else {
2122
+ tokens.push(token);
2123
+ }
2124
+
2125
+ lastParagraphClipped = cutSrc.length !== src.length;
2126
+ src = src.substring(token.raw.length);
2127
+ continue;
2128
+ } // text
2129
+
2130
+
2131
+ if (token = this.tokenizer.text(src)) {
2132
+ src = src.substring(token.raw.length);
2133
+ lastToken = tokens[tokens.length - 1];
2134
+
2135
+ if (lastToken && lastToken.type === 'text') {
2136
+ lastToken.raw += '\n' + token.raw;
2137
+ lastToken.text += '\n' + token.text;
2138
+ this.inlineQueue.pop();
2139
+ this.inlineQueue[this.inlineQueue.length - 1].src = lastToken.text;
2140
+ } else {
2141
+ tokens.push(token);
2142
+ }
2143
+
2144
+ continue;
2145
+ }
2146
+
2147
+ if (src) {
2148
+ var errMsg = 'Infinite loop on byte: ' + src.charCodeAt(0);
2149
+
2150
+ if (this.options.silent) {
2151
+ console.error(errMsg);
2152
+ break;
2153
+ } else {
2154
+ throw new Error(errMsg);
2155
+ }
2156
+ }
2157
+ }
2158
+
2159
+ this.state.top = true;
2160
+ return tokens;
2161
+ };
2162
+
2163
+ _proto.inline = function inline(src, tokens) {
2164
+ if (tokens === void 0) {
2165
+ tokens = [];
2166
+ }
2167
+
2168
+ this.inlineQueue.push({
2169
+ src: src,
2170
+ tokens: tokens
2171
+ });
2172
+ return tokens;
2173
+ }
2174
+ /**
2175
+ * Lexing/Compiling
2176
+ */
2177
+ ;
2178
+
2179
+ _proto.inlineTokens = function inlineTokens(src, tokens) {
2180
+ var _this2 = this;
2181
+
2182
+ if (tokens === void 0) {
2183
+ tokens = [];
2184
+ }
2185
+
2186
+ var token, lastToken, cutSrc; // String with links masked to avoid interference with em and strong
2187
+
2188
+ var maskedSrc = src;
2189
+ var match;
2190
+ var keepPrevChar, prevChar; // Mask out reflinks
2191
+
2192
+ if (this.tokens.links) {
2193
+ var links = Object.keys(this.tokens.links);
2194
+
2195
+ if (links.length > 0) {
2196
+ while ((match = this.tokenizer.rules.inline.reflinkSearch.exec(maskedSrc)) != null) {
2197
+ if (links.includes(match[0].slice(match[0].lastIndexOf('[') + 1, -1))) {
2198
+ maskedSrc = maskedSrc.slice(0, match.index) + '[' + repeatString('a', match[0].length - 2) + ']' + maskedSrc.slice(this.tokenizer.rules.inline.reflinkSearch.lastIndex);
2199
+ }
2200
+ }
2201
+ }
2202
+ } // Mask out other blocks
2203
+
2204
+
2205
+ while ((match = this.tokenizer.rules.inline.blockSkip.exec(maskedSrc)) != null) {
2206
+ maskedSrc = maskedSrc.slice(0, match.index) + '[' + repeatString('a', match[0].length - 2) + ']' + maskedSrc.slice(this.tokenizer.rules.inline.blockSkip.lastIndex);
2207
+ } // Mask out escaped em & strong delimiters
2208
+
2209
+
2210
+ while ((match = this.tokenizer.rules.inline.escapedEmSt.exec(maskedSrc)) != null) {
2211
+ maskedSrc = maskedSrc.slice(0, match.index) + '++' + maskedSrc.slice(this.tokenizer.rules.inline.escapedEmSt.lastIndex);
2212
+ }
2213
+
2214
+ while (src) {
2215
+ if (!keepPrevChar) {
2216
+ prevChar = '';
2217
+ }
2218
+
2219
+ keepPrevChar = false; // extensions
2220
+
2221
+ if (this.options.extensions && this.options.extensions.inline && this.options.extensions.inline.some(function (extTokenizer) {
2222
+ if (token = extTokenizer.call({
2223
+ lexer: _this2
2224
+ }, src, tokens)) {
2225
+ src = src.substring(token.raw.length);
2226
+ tokens.push(token);
2227
+ return true;
2228
+ }
2229
+
2230
+ return false;
2231
+ })) {
2232
+ continue;
2233
+ } // escape
2234
+
2235
+
2236
+ if (token = this.tokenizer.escape(src)) {
2237
+ src = src.substring(token.raw.length);
2238
+ tokens.push(token);
2239
+ continue;
2240
+ } // tag
2241
+
2242
+
2243
+ if (token = this.tokenizer.tag(src)) {
2244
+ src = src.substring(token.raw.length);
2245
+ lastToken = tokens[tokens.length - 1];
2246
+
2247
+ if (lastToken && token.type === 'text' && lastToken.type === 'text') {
2248
+ lastToken.raw += token.raw;
2249
+ lastToken.text += token.text;
2250
+ } else {
2251
+ tokens.push(token);
2252
+ }
2253
+
2254
+ continue;
2255
+ } // link
2256
+
2257
+
2258
+ if (token = this.tokenizer.link(src)) {
2259
+ src = src.substring(token.raw.length);
2260
+ tokens.push(token);
2261
+ continue;
2262
+ } // reflink, nolink
2263
+
2264
+
2265
+ if (token = this.tokenizer.reflink(src, this.tokens.links)) {
2266
+ src = src.substring(token.raw.length);
2267
+ lastToken = tokens[tokens.length - 1];
2268
+
2269
+ if (lastToken && token.type === 'text' && lastToken.type === 'text') {
2270
+ lastToken.raw += token.raw;
2271
+ lastToken.text += token.text;
2272
+ } else {
2273
+ tokens.push(token);
2274
+ }
2275
+
2276
+ continue;
2277
+ } // em & strong
2278
+
2279
+
2280
+ if (token = this.tokenizer.emStrong(src, maskedSrc, prevChar)) {
2281
+ src = src.substring(token.raw.length);
2282
+ tokens.push(token);
2283
+ continue;
2284
+ } // code
2285
+
2286
+
2287
+ if (token = this.tokenizer.codespan(src)) {
2288
+ src = src.substring(token.raw.length);
2289
+ tokens.push(token);
2290
+ continue;
2291
+ } // br
2292
+
2293
+
2294
+ if (token = this.tokenizer.br(src)) {
2295
+ src = src.substring(token.raw.length);
2296
+ tokens.push(token);
2297
+ continue;
2298
+ } // del (gfm)
2299
+
2300
+
2301
+ if (token = this.tokenizer.del(src)) {
2302
+ src = src.substring(token.raw.length);
2303
+ tokens.push(token);
2304
+ continue;
2305
+ } // autolink
2306
+
2307
+
2308
+ if (token = this.tokenizer.autolink(src, mangle)) {
2309
+ src = src.substring(token.raw.length);
2310
+ tokens.push(token);
2311
+ continue;
2312
+ } // url (gfm)
2313
+
2314
+
2315
+ if (!this.state.inLink && (token = this.tokenizer.url(src, mangle))) {
2316
+ src = src.substring(token.raw.length);
2317
+ tokens.push(token);
2318
+ continue;
2319
+ } // text
2320
+ // prevent inlineText consuming extensions by clipping 'src' to extension start
2321
+
2322
+
2323
+ cutSrc = src;
2324
+
2325
+ if (this.options.extensions && this.options.extensions.startInline) {
2326
+ (function () {
2327
+ var startIndex = Infinity;
2328
+ var tempSrc = src.slice(1);
2329
+ var tempStart = void 0;
2330
+
2331
+ _this2.options.extensions.startInline.forEach(function (getStartIndex) {
2332
+ tempStart = getStartIndex.call({
2333
+ lexer: this
2334
+ }, tempSrc);
2335
+
2336
+ if (typeof tempStart === 'number' && tempStart >= 0) {
2337
+ startIndex = Math.min(startIndex, tempStart);
2338
+ }
2339
+ });
2340
+
2341
+ if (startIndex < Infinity && startIndex >= 0) {
2342
+ cutSrc = src.substring(0, startIndex + 1);
2343
+ }
2344
+ })();
2345
+ }
2346
+
2347
+ if (token = this.tokenizer.inlineText(cutSrc, smartypants)) {
2348
+ src = src.substring(token.raw.length);
2349
+
2350
+ if (token.raw.slice(-1) !== '_') {
2351
+ // Track prevChar before string of ____ started
2352
+ prevChar = token.raw.slice(-1);
2353
+ }
2354
+
2355
+ keepPrevChar = true;
2356
+ lastToken = tokens[tokens.length - 1];
2357
+
2358
+ if (lastToken && lastToken.type === 'text') {
2359
+ lastToken.raw += token.raw;
2360
+ lastToken.text += token.text;
2361
+ } else {
2362
+ tokens.push(token);
2363
+ }
2364
+
2365
+ continue;
2366
+ }
2367
+
2368
+ if (src) {
2369
+ var errMsg = 'Infinite loop on byte: ' + src.charCodeAt(0);
2370
+
2371
+ if (this.options.silent) {
2372
+ console.error(errMsg);
2373
+ break;
2374
+ } else {
2375
+ throw new Error(errMsg);
2376
+ }
2377
+ }
2378
+ }
2379
+
2380
+ return tokens;
2381
+ };
2382
+
2383
+ _createClass(Lexer, null, [{
2384
+ key: "rules",
2385
+ get: function get() {
2386
+ return {
2387
+ block: block,
2388
+ inline: inline
2389
+ };
2390
+ }
2391
+ }]);
2392
+
2393
+ return Lexer;
2394
+ }();
2395
+
2396
+ /**
2397
+ * Renderer
2398
+ */
2399
+
2400
+ var Renderer = /*#__PURE__*/function () {
2401
+ function Renderer(options) {
2402
+ this.options = options || exports.defaults;
2403
+ }
2404
+
2405
+ var _proto = Renderer.prototype;
2406
+
2407
+ _proto.code = function code(_code, infostring, escaped) {
2408
+ var lang = (infostring || '').match(/\S*/)[0];
2409
+
2410
+ if (this.options.highlight) {
2411
+ var out = this.options.highlight(_code, lang);
2412
+
2413
+ if (out != null && out !== _code) {
2414
+ escaped = true;
2415
+ _code = out;
2416
+ }
2417
+ }
2418
+
2419
+ _code = _code.replace(/\n$/, '') + '\n';
2420
+
2421
+ if (!lang) {
2422
+ return '<pre><code>' + (escaped ? _code : escape(_code, true)) + '</code></pre>\n';
2423
+ }
2424
+
2425
+ return '<pre><code class="' + this.options.langPrefix + escape(lang, true) + '">' + (escaped ? _code : escape(_code, true)) + '</code></pre>\n';
2426
+ }
2427
+ /**
2428
+ * @param {string} quote
2429
+ */
2430
+ ;
2431
+
2432
+ _proto.blockquote = function blockquote(quote) {
2433
+ return "<blockquote>\n" + quote + "</blockquote>\n";
2434
+ };
2435
+
2436
+ _proto.html = function html(_html) {
2437
+ return _html;
2438
+ }
2439
+ /**
2440
+ * @param {string} text
2441
+ * @param {string} level
2442
+ * @param {string} raw
2443
+ * @param {any} slugger
2444
+ */
2445
+ ;
2446
+
2447
+ _proto.heading = function heading(text, level, raw, slugger) {
2448
+ if (this.options.headerIds) {
2449
+ var id = this.options.headerPrefix + slugger.slug(raw);
2450
+ return "<h" + level + " id=\"" + id + "\">" + text + "</h" + level + ">\n";
2451
+ } // ignore IDs
2452
+
2453
+
2454
+ return "<h" + level + ">" + text + "</h" + level + ">\n";
2455
+ };
2456
+
2457
+ _proto.hr = function hr() {
2458
+ return this.options.xhtml ? '<hr/>\n' : '<hr>\n';
2459
+ };
2460
+
2461
+ _proto.list = function list(body, ordered, start) {
2462
+ var type = ordered ? 'ol' : 'ul',
2463
+ startatt = ordered && start !== 1 ? ' start="' + start + '"' : '';
2464
+ return '<' + type + startatt + '>\n' + body + '</' + type + '>\n';
2465
+ }
2466
+ /**
2467
+ * @param {string} text
2468
+ */
2469
+ ;
2470
+
2471
+ _proto.listitem = function listitem(text) {
2472
+ return "<li>" + text + "</li>\n";
2473
+ };
2474
+
2475
+ _proto.checkbox = function checkbox(checked) {
2476
+ return '<input ' + (checked ? 'checked="" ' : '') + 'disabled="" type="checkbox"' + (this.options.xhtml ? ' /' : '') + '> ';
2477
+ }
2478
+ /**
2479
+ * @param {string} text
2480
+ */
2481
+ ;
2482
+
2483
+ _proto.paragraph = function paragraph(text) {
2484
+ return "<p>" + text + "</p>\n";
2485
+ }
2486
+ /**
2487
+ * @param {string} header
2488
+ * @param {string} body
2489
+ */
2490
+ ;
2491
+
2492
+ _proto.table = function table(header, body) {
2493
+ if (body) body = "<tbody>" + body + "</tbody>";
2494
+ return '<table>\n' + '<thead>\n' + header + '</thead>\n' + body + '</table>\n';
2495
+ }
2496
+ /**
2497
+ * @param {string} content
2498
+ */
2499
+ ;
2500
+
2501
+ _proto.tablerow = function tablerow(content) {
2502
+ return "<tr>\n" + content + "</tr>\n";
2503
+ };
2504
+
2505
+ _proto.tablecell = function tablecell(content, flags) {
2506
+ var type = flags.header ? 'th' : 'td';
2507
+ var tag = flags.align ? "<" + type + " align=\"" + flags.align + "\">" : "<" + type + ">";
2508
+ return tag + content + ("</" + type + ">\n");
2509
+ }
2510
+ /**
2511
+ * span level renderer
2512
+ * @param {string} text
2513
+ */
2514
+ ;
2515
+
2516
+ _proto.strong = function strong(text) {
2517
+ return "<strong>" + text + "</strong>";
2518
+ }
2519
+ /**
2520
+ * @param {string} text
2521
+ */
2522
+ ;
2523
+
2524
+ _proto.em = function em(text) {
2525
+ return "<em>" + text + "</em>";
2526
+ }
2527
+ /**
2528
+ * @param {string} text
2529
+ */
2530
+ ;
2531
+
2532
+ _proto.codespan = function codespan(text) {
2533
+ return "<code>" + text + "</code>";
2534
+ };
2535
+
2536
+ _proto.br = function br() {
2537
+ return this.options.xhtml ? '<br/>' : '<br>';
2538
+ }
2539
+ /**
2540
+ * @param {string} text
2541
+ */
2542
+ ;
2543
+
2544
+ _proto.del = function del(text) {
2545
+ return "<del>" + text + "</del>";
2546
+ }
2547
+ /**
2548
+ * @param {string} href
2549
+ * @param {string} title
2550
+ * @param {string} text
2551
+ */
2552
+ ;
2553
+
2554
+ _proto.link = function link(href, title, text) {
2555
+ href = cleanUrl(this.options.sanitize, this.options.baseUrl, href);
2556
+
2557
+ if (href === null) {
2558
+ return text;
2559
+ }
2560
+
2561
+ var out = '<a href="' + escape(href) + '"';
2562
+
2563
+ if (title) {
2564
+ out += ' title="' + title + '"';
2565
+ }
2566
+
2567
+ out += '>' + text + '</a>';
2568
+ return out;
2569
+ }
2570
+ /**
2571
+ * @param {string} href
2572
+ * @param {string} title
2573
+ * @param {string} text
2574
+ */
2575
+ ;
2576
+
2577
+ _proto.image = function image(href, title, text) {
2578
+ href = cleanUrl(this.options.sanitize, this.options.baseUrl, href);
2579
+
2580
+ if (href === null) {
2581
+ return text;
2582
+ }
2583
+
2584
+ var out = "<img src=\"" + href + "\" alt=\"" + text + "\"";
2585
+
2586
+ if (title) {
2587
+ out += " title=\"" + title + "\"";
2588
+ }
2589
+
2590
+ out += this.options.xhtml ? '/>' : '>';
2591
+ return out;
2592
+ };
2593
+
2594
+ _proto.text = function text(_text) {
2595
+ return _text;
2596
+ };
2597
+
2598
+ return Renderer;
2599
+ }();
2600
+
2601
+ /**
2602
+ * TextRenderer
2603
+ * returns only the textual part of the token
2604
+ */
2605
+ var TextRenderer = /*#__PURE__*/function () {
2606
+ function TextRenderer() {}
2607
+
2608
+ var _proto = TextRenderer.prototype;
2609
+
2610
+ // no need for block level renderers
2611
+ _proto.strong = function strong(text) {
2612
+ return text;
2613
+ };
2614
+
2615
+ _proto.em = function em(text) {
2616
+ return text;
2617
+ };
2618
+
2619
+ _proto.codespan = function codespan(text) {
2620
+ return text;
2621
+ };
2622
+
2623
+ _proto.del = function del(text) {
2624
+ return text;
2625
+ };
2626
+
2627
+ _proto.html = function html(text) {
2628
+ return text;
2629
+ };
2630
+
2631
+ _proto.text = function text(_text) {
2632
+ return _text;
2633
+ };
2634
+
2635
+ _proto.link = function link(href, title, text) {
2636
+ return '' + text;
2637
+ };
2638
+
2639
+ _proto.image = function image(href, title, text) {
2640
+ return '' + text;
2641
+ };
2642
+
2643
+ _proto.br = function br() {
2644
+ return '';
2645
+ };
2646
+
2647
+ return TextRenderer;
2648
+ }();
2649
+
2650
+ /**
2651
+ * Slugger generates header id
2652
+ */
2653
+ var Slugger = /*#__PURE__*/function () {
2654
+ function Slugger() {
2655
+ this.seen = {};
2656
+ }
2657
+ /**
2658
+ * @param {string} value
2659
+ */
2660
+
2661
+
2662
+ var _proto = Slugger.prototype;
2663
+
2664
+ _proto.serialize = function serialize(value) {
2665
+ return value.toLowerCase().trim() // remove html tags
2666
+ .replace(/<[!\/a-z].*?>/ig, '') // remove unwanted chars
2667
+ .replace(/[\u2000-\u206F\u2E00-\u2E7F\\'!"#$%&()*+,./:;<=>?@[\]^`{|}~]/g, '').replace(/\s/g, '-');
2668
+ }
2669
+ /**
2670
+ * Finds the next safe (unique) slug to use
2671
+ * @param {string} originalSlug
2672
+ * @param {boolean} isDryRun
2673
+ */
2674
+ ;
2675
+
2676
+ _proto.getNextSafeSlug = function getNextSafeSlug(originalSlug, isDryRun) {
2677
+ var slug = originalSlug;
2678
+ var occurenceAccumulator = 0;
2679
+
2680
+ if (this.seen.hasOwnProperty(slug)) {
2681
+ occurenceAccumulator = this.seen[originalSlug];
2682
+
2683
+ do {
2684
+ occurenceAccumulator++;
2685
+ slug = originalSlug + '-' + occurenceAccumulator;
2686
+ } while (this.seen.hasOwnProperty(slug));
2687
+ }
2688
+
2689
+ if (!isDryRun) {
2690
+ this.seen[originalSlug] = occurenceAccumulator;
2691
+ this.seen[slug] = 0;
2692
+ }
2693
+
2694
+ return slug;
2695
+ }
2696
+ /**
2697
+ * Convert string to unique id
2698
+ * @param {object} [options]
2699
+ * @param {boolean} [options.dryrun] Generates the next unique slug without
2700
+ * updating the internal accumulator.
2701
+ */
2702
+ ;
2703
+
2704
+ _proto.slug = function slug(value, options) {
2705
+ if (options === void 0) {
2706
+ options = {};
2707
+ }
2708
+
2709
+ var slug = this.serialize(value);
2710
+ return this.getNextSafeSlug(slug, options.dryrun);
2711
+ };
2712
+
2713
+ return Slugger;
2714
+ }();
2715
+
2716
+ /**
2717
+ * Parsing & Compiling
2718
+ */
2719
+
2720
+ var Parser = /*#__PURE__*/function () {
2721
+ function Parser(options) {
2722
+ this.options = options || exports.defaults;
2723
+ this.options.renderer = this.options.renderer || new Renderer();
2724
+ this.renderer = this.options.renderer;
2725
+ this.renderer.options = this.options;
2726
+ this.textRenderer = new TextRenderer();
2727
+ this.slugger = new Slugger();
2728
+ }
2729
+ /**
2730
+ * Static Parse Method
2731
+ */
2732
+
2733
+
2734
+ Parser.parse = function parse(tokens, options) {
2735
+ var parser = new Parser(options);
2736
+ return parser.parse(tokens);
2737
+ }
2738
+ /**
2739
+ * Static Parse Inline Method
2740
+ */
2741
+ ;
2742
+
2743
+ Parser.parseInline = function parseInline(tokens, options) {
2744
+ var parser = new Parser(options);
2745
+ return parser.parseInline(tokens);
2746
+ }
2747
+ /**
2748
+ * Parse Loop
2749
+ */
2750
+ ;
2751
+
2752
+ var _proto = Parser.prototype;
2753
+
2754
+ _proto.parse = function parse(tokens, top) {
2755
+ if (top === void 0) {
2756
+ top = true;
2757
+ }
2758
+
2759
+ var out = '',
2760
+ i,
2761
+ j,
2762
+ k,
2763
+ l2,
2764
+ l3,
2765
+ row,
2766
+ cell,
2767
+ header,
2768
+ body,
2769
+ token,
2770
+ ordered,
2771
+ start,
2772
+ loose,
2773
+ itemBody,
2774
+ item,
2775
+ checked,
2776
+ task,
2777
+ checkbox,
2778
+ ret;
2779
+ var l = tokens.length;
2780
+
2781
+ for (i = 0; i < l; i++) {
2782
+ token = tokens[i]; // Run any renderer extensions
2783
+
2784
+ if (this.options.extensions && this.options.extensions.renderers && this.options.extensions.renderers[token.type]) {
2785
+ ret = this.options.extensions.renderers[token.type].call({
2786
+ parser: this
2787
+ }, token);
2788
+
2789
+ if (ret !== false || !['space', 'hr', 'heading', 'code', 'table', 'blockquote', 'list', 'html', 'paragraph', 'text'].includes(token.type)) {
2790
+ out += ret || '';
2791
+ continue;
2792
+ }
2793
+ }
2794
+
2795
+ switch (token.type) {
2796
+ case 'space':
2797
+ {
2798
+ continue;
2799
+ }
2800
+
2801
+ case 'hr':
2802
+ {
2803
+ out += this.renderer.hr();
2804
+ continue;
2805
+ }
2806
+
2807
+ case 'heading':
2808
+ {
2809
+ out += this.renderer.heading(this.parseInline(token.tokens), token.depth, unescape(this.parseInline(token.tokens, this.textRenderer)), this.slugger);
2810
+ continue;
2811
+ }
2812
+
2813
+ case 'code':
2814
+ {
2815
+ out += this.renderer.code(token.text, token.lang, token.escaped);
2816
+ continue;
2817
+ }
2818
+
2819
+ case 'table':
2820
+ {
2821
+ header = ''; // header
2822
+
2823
+ cell = '';
2824
+ l2 = token.header.length;
2825
+
2826
+ for (j = 0; j < l2; j++) {
2827
+ cell += this.renderer.tablecell(this.parseInline(token.header[j].tokens), {
2828
+ header: true,
2829
+ align: token.align[j]
2830
+ });
2831
+ }
2832
+
2833
+ header += this.renderer.tablerow(cell);
2834
+ body = '';
2835
+ l2 = token.rows.length;
2836
+
2837
+ for (j = 0; j < l2; j++) {
2838
+ row = token.rows[j];
2839
+ cell = '';
2840
+ l3 = row.length;
2841
+
2842
+ for (k = 0; k < l3; k++) {
2843
+ cell += this.renderer.tablecell(this.parseInline(row[k].tokens), {
2844
+ header: false,
2845
+ align: token.align[k]
2846
+ });
2847
+ }
2848
+
2849
+ body += this.renderer.tablerow(cell);
2850
+ }
2851
+
2852
+ out += this.renderer.table(header, body);
2853
+ continue;
2854
+ }
2855
+
2856
+ case 'blockquote':
2857
+ {
2858
+ body = this.parse(token.tokens);
2859
+ out += this.renderer.blockquote(body);
2860
+ continue;
2861
+ }
2862
+
2863
+ case 'list':
2864
+ {
2865
+ ordered = token.ordered;
2866
+ start = token.start;
2867
+ loose = token.loose;
2868
+ l2 = token.items.length;
2869
+ body = '';
2870
+
2871
+ for (j = 0; j < l2; j++) {
2872
+ item = token.items[j];
2873
+ checked = item.checked;
2874
+ task = item.task;
2875
+ itemBody = '';
2876
+
2877
+ if (item.task) {
2878
+ checkbox = this.renderer.checkbox(checked);
2879
+
2880
+ if (loose) {
2881
+ if (item.tokens.length > 0 && item.tokens[0].type === 'paragraph') {
2882
+ item.tokens[0].text = checkbox + ' ' + item.tokens[0].text;
2883
+
2884
+ if (item.tokens[0].tokens && item.tokens[0].tokens.length > 0 && item.tokens[0].tokens[0].type === 'text') {
2885
+ item.tokens[0].tokens[0].text = checkbox + ' ' + item.tokens[0].tokens[0].text;
2886
+ }
2887
+ } else {
2888
+ item.tokens.unshift({
2889
+ type: 'text',
2890
+ text: checkbox
2891
+ });
2892
+ }
2893
+ } else {
2894
+ itemBody += checkbox;
2895
+ }
2896
+ }
2897
+
2898
+ itemBody += this.parse(item.tokens, loose);
2899
+ body += this.renderer.listitem(itemBody, task, checked);
2900
+ }
2901
+
2902
+ out += this.renderer.list(body, ordered, start);
2903
+ continue;
2904
+ }
2905
+
2906
+ case 'html':
2907
+ {
2908
+ // TODO parse inline content if parameter markdown=1
2909
+ out += this.renderer.html(token.text);
2910
+ continue;
2911
+ }
2912
+
2913
+ case 'paragraph':
2914
+ {
2915
+ out += this.renderer.paragraph(this.parseInline(token.tokens));
2916
+ continue;
2917
+ }
2918
+
2919
+ case 'text':
2920
+ {
2921
+ body = token.tokens ? this.parseInline(token.tokens) : token.text;
2922
+
2923
+ while (i + 1 < l && tokens[i + 1].type === 'text') {
2924
+ token = tokens[++i];
2925
+ body += '\n' + (token.tokens ? this.parseInline(token.tokens) : token.text);
2926
+ }
2927
+
2928
+ out += top ? this.renderer.paragraph(body) : body;
2929
+ continue;
2930
+ }
2931
+
2932
+ default:
2933
+ {
2934
+ var errMsg = 'Token with "' + token.type + '" type was not found.';
2935
+
2936
+ if (this.options.silent) {
2937
+ console.error(errMsg);
2938
+ return;
2939
+ } else {
2940
+ throw new Error(errMsg);
2941
+ }
2942
+ }
2943
+ }
2944
+ }
2945
+
2946
+ return out;
2947
+ }
2948
+ /**
2949
+ * Parse Inline Tokens
2950
+ */
2951
+ ;
2952
+
2953
+ _proto.parseInline = function parseInline(tokens, renderer) {
2954
+ renderer = renderer || this.renderer;
2955
+ var out = '',
2956
+ i,
2957
+ token,
2958
+ ret;
2959
+ var l = tokens.length;
2960
+
2961
+ for (i = 0; i < l; i++) {
2962
+ token = tokens[i]; // Run any renderer extensions
2963
+
2964
+ if (this.options.extensions && this.options.extensions.renderers && this.options.extensions.renderers[token.type]) {
2965
+ ret = this.options.extensions.renderers[token.type].call({
2966
+ parser: this
2967
+ }, token);
2968
+
2969
+ if (ret !== false || !['escape', 'html', 'link', 'image', 'strong', 'em', 'codespan', 'br', 'del', 'text'].includes(token.type)) {
2970
+ out += ret || '';
2971
+ continue;
2972
+ }
2973
+ }
2974
+
2975
+ switch (token.type) {
2976
+ case 'escape':
2977
+ {
2978
+ out += renderer.text(token.text);
2979
+ break;
2980
+ }
2981
+
2982
+ case 'html':
2983
+ {
2984
+ out += renderer.html(token.text);
2985
+ break;
2986
+ }
2987
+
2988
+ case 'link':
2989
+ {
2990
+ out += renderer.link(token.href, token.title, this.parseInline(token.tokens, renderer));
2991
+ break;
2992
+ }
2993
+
2994
+ case 'image':
2995
+ {
2996
+ out += renderer.image(token.href, token.title, token.text);
2997
+ break;
2998
+ }
2999
+
3000
+ case 'strong':
3001
+ {
3002
+ out += renderer.strong(this.parseInline(token.tokens, renderer));
3003
+ break;
3004
+ }
3005
+
3006
+ case 'em':
3007
+ {
3008
+ out += renderer.em(this.parseInline(token.tokens, renderer));
3009
+ break;
3010
+ }
3011
+
3012
+ case 'codespan':
3013
+ {
3014
+ out += renderer.codespan(token.text);
3015
+ break;
3016
+ }
3017
+
3018
+ case 'br':
3019
+ {
3020
+ out += renderer.br();
3021
+ break;
3022
+ }
3023
+
3024
+ case 'del':
3025
+ {
3026
+ out += renderer.del(this.parseInline(token.tokens, renderer));
3027
+ break;
3028
+ }
3029
+
3030
+ case 'text':
3031
+ {
3032
+ out += renderer.text(token.text);
3033
+ break;
3034
+ }
3035
+
3036
+ default:
3037
+ {
3038
+ var errMsg = 'Token with "' + token.type + '" type was not found.';
3039
+
3040
+ if (this.options.silent) {
3041
+ console.error(errMsg);
3042
+ return;
3043
+ } else {
3044
+ throw new Error(errMsg);
3045
+ }
3046
+ }
3047
+ }
3048
+ }
3049
+
3050
+ return out;
3051
+ };
3052
+
3053
+ return Parser;
3054
+ }();
3055
+
3056
+ /**
3057
+ * Marked
3058
+ */
3059
+
3060
+ function marked(src, opt, callback) {
3061
+ // throw error in case of non string input
3062
+ if (typeof src === 'undefined' || src === null) {
3063
+ throw new Error('marked(): input parameter is undefined or null');
3064
+ }
3065
+
3066
+ if (typeof src !== 'string') {
3067
+ throw new Error('marked(): input parameter is of type ' + Object.prototype.toString.call(src) + ', string expected');
3068
+ }
3069
+
3070
+ if (typeof opt === 'function') {
3071
+ callback = opt;
3072
+ opt = null;
3073
+ }
3074
+
3075
+ opt = merge({}, marked.defaults, opt || {});
3076
+ checkSanitizeDeprecation(opt);
3077
+
3078
+ if (callback) {
3079
+ var highlight = opt.highlight;
3080
+ var tokens;
3081
+
3082
+ try {
3083
+ tokens = Lexer.lex(src, opt);
3084
+ } catch (e) {
3085
+ return callback(e);
3086
+ }
3087
+
3088
+ var done = function done(err) {
3089
+ var out;
3090
+
3091
+ if (!err) {
3092
+ try {
3093
+ if (opt.walkTokens) {
3094
+ marked.walkTokens(tokens, opt.walkTokens);
3095
+ }
3096
+
3097
+ out = Parser.parse(tokens, opt);
3098
+ } catch (e) {
3099
+ err = e;
3100
+ }
3101
+ }
3102
+
3103
+ opt.highlight = highlight;
3104
+ return err ? callback(err) : callback(null, out);
3105
+ };
3106
+
3107
+ if (!highlight || highlight.length < 3) {
3108
+ return done();
3109
+ }
3110
+
3111
+ delete opt.highlight;
3112
+ if (!tokens.length) return done();
3113
+ var pending = 0;
3114
+ marked.walkTokens(tokens, function (token) {
3115
+ if (token.type === 'code') {
3116
+ pending++;
3117
+ setTimeout(function () {
3118
+ highlight(token.text, token.lang, function (err, code) {
3119
+ if (err) {
3120
+ return done(err);
3121
+ }
3122
+
3123
+ if (code != null && code !== token.text) {
3124
+ token.text = code;
3125
+ token.escaped = true;
3126
+ }
3127
+
3128
+ pending--;
3129
+
3130
+ if (pending === 0) {
3131
+ done();
3132
+ }
3133
+ });
3134
+ }, 0);
3135
+ }
3136
+ });
3137
+
3138
+ if (pending === 0) {
3139
+ done();
3140
+ }
3141
+
3142
+ return;
3143
+ }
3144
+
3145
+ function onError(e) {
3146
+ e.message += '\nPlease report this to https://github.com/markedjs/marked.';
3147
+
3148
+ if (opt.silent) {
3149
+ return '<p>An error occurred:</p><pre>' + escape(e.message + '', true) + '</pre>';
3150
+ }
3151
+
3152
+ throw e;
3153
+ }
3154
+
3155
+ try {
3156
+ var _tokens = Lexer.lex(src, opt);
3157
+
3158
+ if (opt.walkTokens) {
3159
+ if (opt.async) {
3160
+ return Promise.all(marked.walkTokens(_tokens, opt.walkTokens)).then(function () {
3161
+ return Parser.parse(_tokens, opt);
3162
+ })["catch"](onError);
3163
+ }
3164
+
3165
+ marked.walkTokens(_tokens, opt.walkTokens);
3166
+ }
3167
+
3168
+ return Parser.parse(_tokens, opt);
3169
+ } catch (e) {
3170
+ onError(e);
3171
+ }
3172
+ }
3173
+ /**
3174
+ * Options
3175
+ */
3176
+
3177
+ marked.options = marked.setOptions = function (opt) {
3178
+ merge(marked.defaults, opt);
3179
+ changeDefaults(marked.defaults);
3180
+ return marked;
3181
+ };
3182
+
3183
+ marked.getDefaults = getDefaults;
3184
+ marked.defaults = exports.defaults;
3185
+ /**
3186
+ * Use Extension
3187
+ */
3188
+
3189
+ marked.use = function () {
3190
+ for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
3191
+ args[_key] = arguments[_key];
3192
+ }
3193
+
3194
+ var opts = merge.apply(void 0, [{}].concat(args));
3195
+ var extensions = marked.defaults.extensions || {
3196
+ renderers: {},
3197
+ childTokens: {}
3198
+ };
3199
+ var hasExtensions;
3200
+ args.forEach(function (pack) {
3201
+ // ==-- Parse "addon" extensions --== //
3202
+ if (pack.extensions) {
3203
+ hasExtensions = true;
3204
+ pack.extensions.forEach(function (ext) {
3205
+ if (!ext.name) {
3206
+ throw new Error('extension name required');
3207
+ }
3208
+
3209
+ if (ext.renderer) {
3210
+ // Renderer extensions
3211
+ var prevRenderer = extensions.renderers ? extensions.renderers[ext.name] : null;
3212
+
3213
+ if (prevRenderer) {
3214
+ // Replace extension with func to run new extension but fall back if false
3215
+ extensions.renderers[ext.name] = function () {
3216
+ for (var _len2 = arguments.length, args = new Array(_len2), _key2 = 0; _key2 < _len2; _key2++) {
3217
+ args[_key2] = arguments[_key2];
3218
+ }
3219
+
3220
+ var ret = ext.renderer.apply(this, args);
3221
+
3222
+ if (ret === false) {
3223
+ ret = prevRenderer.apply(this, args);
3224
+ }
3225
+
3226
+ return ret;
3227
+ };
3228
+ } else {
3229
+ extensions.renderers[ext.name] = ext.renderer;
3230
+ }
3231
+ }
3232
+
3233
+ if (ext.tokenizer) {
3234
+ // Tokenizer Extensions
3235
+ if (!ext.level || ext.level !== 'block' && ext.level !== 'inline') {
3236
+ throw new Error("extension level must be 'block' or 'inline'");
3237
+ }
3238
+
3239
+ if (extensions[ext.level]) {
3240
+ extensions[ext.level].unshift(ext.tokenizer);
3241
+ } else {
3242
+ extensions[ext.level] = [ext.tokenizer];
3243
+ }
3244
+
3245
+ if (ext.start) {
3246
+ // Function to check for start of token
3247
+ if (ext.level === 'block') {
3248
+ if (extensions.startBlock) {
3249
+ extensions.startBlock.push(ext.start);
3250
+ } else {
3251
+ extensions.startBlock = [ext.start];
3252
+ }
3253
+ } else if (ext.level === 'inline') {
3254
+ if (extensions.startInline) {
3255
+ extensions.startInline.push(ext.start);
3256
+ } else {
3257
+ extensions.startInline = [ext.start];
3258
+ }
3259
+ }
3260
+ }
3261
+ }
3262
+
3263
+ if (ext.childTokens) {
3264
+ // Child tokens to be visited by walkTokens
3265
+ extensions.childTokens[ext.name] = ext.childTokens;
3266
+ }
3267
+ });
3268
+ } // ==-- Parse "overwrite" extensions --== //
3269
+
3270
+
3271
+ if (pack.renderer) {
3272
+ (function () {
3273
+ var renderer = marked.defaults.renderer || new Renderer();
3274
+
3275
+ var _loop = function _loop(prop) {
3276
+ var prevRenderer = renderer[prop]; // Replace renderer with func to run extension, but fall back if false
3277
+
3278
+ renderer[prop] = function () {
3279
+ for (var _len3 = arguments.length, args = new Array(_len3), _key3 = 0; _key3 < _len3; _key3++) {
3280
+ args[_key3] = arguments[_key3];
3281
+ }
3282
+
3283
+ var ret = pack.renderer[prop].apply(renderer, args);
3284
+
3285
+ if (ret === false) {
3286
+ ret = prevRenderer.apply(renderer, args);
3287
+ }
3288
+
3289
+ return ret;
3290
+ };
3291
+ };
3292
+
3293
+ for (var prop in pack.renderer) {
3294
+ _loop(prop);
3295
+ }
3296
+
3297
+ opts.renderer = renderer;
3298
+ })();
3299
+ }
3300
+
3301
+ if (pack.tokenizer) {
3302
+ (function () {
3303
+ var tokenizer = marked.defaults.tokenizer || new Tokenizer();
3304
+
3305
+ var _loop2 = function _loop2(prop) {
3306
+ var prevTokenizer = tokenizer[prop]; // Replace tokenizer with func to run extension, but fall back if false
3307
+
3308
+ tokenizer[prop] = function () {
3309
+ for (var _len4 = arguments.length, args = new Array(_len4), _key4 = 0; _key4 < _len4; _key4++) {
3310
+ args[_key4] = arguments[_key4];
3311
+ }
3312
+
3313
+ var ret = pack.tokenizer[prop].apply(tokenizer, args);
3314
+
3315
+ if (ret === false) {
3316
+ ret = prevTokenizer.apply(tokenizer, args);
3317
+ }
3318
+
3319
+ return ret;
3320
+ };
3321
+ };
3322
+
3323
+ for (var prop in pack.tokenizer) {
3324
+ _loop2(prop);
3325
+ }
3326
+
3327
+ opts.tokenizer = tokenizer;
3328
+ })();
3329
+ } // ==-- Parse WalkTokens extensions --== //
3330
+
3331
+
3332
+ if (pack.walkTokens) {
3333
+ var _walkTokens = marked.defaults.walkTokens;
3334
+
3335
+ opts.walkTokens = function (token) {
3336
+ var values = [];
3337
+ values.push(pack.walkTokens.call(this, token));
3338
+
3339
+ if (_walkTokens) {
3340
+ values = values.concat(_walkTokens.call(this, token));
3341
+ }
3342
+
3343
+ return values;
3344
+ };
3345
+ }
3346
+
3347
+ if (hasExtensions) {
3348
+ opts.extensions = extensions;
3349
+ }
3350
+
3351
+ marked.setOptions(opts);
3352
+ });
3353
+ };
3354
+ /**
3355
+ * Run callback for every token
3356
+ */
3357
+
3358
+
3359
+ marked.walkTokens = function (tokens, callback) {
3360
+ var values = [];
3361
+
3362
+ var _loop3 = function _loop3() {
3363
+ var token = _step.value;
3364
+ values = values.concat(callback.call(marked, token));
3365
+
3366
+ switch (token.type) {
3367
+ case 'table':
3368
+ {
3369
+ for (var _iterator2 = _createForOfIteratorHelperLoose(token.header), _step2; !(_step2 = _iterator2()).done;) {
3370
+ var cell = _step2.value;
3371
+ values = values.concat(marked.walkTokens(cell.tokens, callback));
3372
+ }
3373
+
3374
+ for (var _iterator3 = _createForOfIteratorHelperLoose(token.rows), _step3; !(_step3 = _iterator3()).done;) {
3375
+ var row = _step3.value;
3376
+
3377
+ for (var _iterator4 = _createForOfIteratorHelperLoose(row), _step4; !(_step4 = _iterator4()).done;) {
3378
+ var _cell = _step4.value;
3379
+ values = values.concat(marked.walkTokens(_cell.tokens, callback));
3380
+ }
3381
+ }
3382
+
3383
+ break;
3384
+ }
3385
+
3386
+ case 'list':
3387
+ {
3388
+ values = values.concat(marked.walkTokens(token.items, callback));
3389
+ break;
3390
+ }
3391
+
3392
+ default:
3393
+ {
3394
+ if (marked.defaults.extensions && marked.defaults.extensions.childTokens && marked.defaults.extensions.childTokens[token.type]) {
3395
+ // Walk any extensions
3396
+ marked.defaults.extensions.childTokens[token.type].forEach(function (childTokens) {
3397
+ values = values.concat(marked.walkTokens(token[childTokens], callback));
3398
+ });
3399
+ } else if (token.tokens) {
3400
+ values = values.concat(marked.walkTokens(token.tokens, callback));
3401
+ }
3402
+ }
3403
+ }
3404
+ };
3405
+
3406
+ for (var _iterator = _createForOfIteratorHelperLoose(tokens), _step; !(_step = _iterator()).done;) {
3407
+ _loop3();
3408
+ }
3409
+
3410
+ return values;
3411
+ };
3412
+ /**
3413
+ * Parse Inline
3414
+ * @param {string} src
3415
+ */
3416
+
3417
+
3418
+ marked.parseInline = function (src, opt) {
3419
+ // throw error in case of non string input
3420
+ if (typeof src === 'undefined' || src === null) {
3421
+ throw new Error('marked.parseInline(): input parameter is undefined or null');
3422
+ }
3423
+
3424
+ if (typeof src !== 'string') {
3425
+ throw new Error('marked.parseInline(): input parameter is of type ' + Object.prototype.toString.call(src) + ', string expected');
3426
+ }
3427
+
3428
+ opt = merge({}, marked.defaults, opt || {});
3429
+ checkSanitizeDeprecation(opt);
3430
+
3431
+ try {
3432
+ var tokens = Lexer.lexInline(src, opt);
3433
+
3434
+ if (opt.walkTokens) {
3435
+ marked.walkTokens(tokens, opt.walkTokens);
3436
+ }
3437
+
3438
+ return Parser.parseInline(tokens, opt);
3439
+ } catch (e) {
3440
+ e.message += '\nPlease report this to https://github.com/markedjs/marked.';
3441
+
3442
+ if (opt.silent) {
3443
+ return '<p>An error occurred:</p><pre>' + escape(e.message + '', true) + '</pre>';
3444
+ }
3445
+
3446
+ throw e;
3447
+ }
3448
+ };
3449
+ /**
3450
+ * Expose
3451
+ */
3452
+
3453
+
3454
+ marked.Parser = Parser;
3455
+ marked.parser = Parser.parse;
3456
+ marked.Renderer = Renderer;
3457
+ marked.TextRenderer = TextRenderer;
3458
+ marked.Lexer = Lexer;
3459
+ marked.lexer = Lexer.lex;
3460
+ marked.Tokenizer = Tokenizer;
3461
+ marked.Slugger = Slugger;
3462
+ marked.parse = marked;
3463
+ var options = marked.options;
3464
+ var setOptions = marked.setOptions;
3465
+ var use = marked.use;
3466
+ var walkTokens = marked.walkTokens;
3467
+ var parseInline = marked.parseInline;
3468
+ var parse = marked;
3469
+ var parser = Parser.parse;
3470
+ var lexer = Lexer.lex;
3471
+
3472
+ exports.Lexer = Lexer;
3473
+ exports.Parser = Parser;
3474
+ exports.Renderer = Renderer;
3475
+ exports.Slugger = Slugger;
3476
+ exports.TextRenderer = TextRenderer;
3477
+ exports.Tokenizer = Tokenizer;
3478
+ exports.getDefaults = getDefaults;
3479
+ exports.lexer = lexer;
3480
+ exports.marked = marked;
3481
+ exports.options = options;
3482
+ exports.parse = parse;
3483
+ exports.parseInline = parseInline;
3484
+ exports.parser = parser;
3485
+ exports.setOptions = setOptions;
3486
+ exports.use = use;
3487
+ exports.walkTokens = walkTokens;
3488
+
3489
+ Object.defineProperty(exports, '__esModule', { value: true });
3490
+
3491
+ }));
3492
+
3493
+
425
3494
  /***/ }),
426
3495
 
427
3496
  /***/ "7c81":
@@ -804,7 +3873,7 @@ if (typeof window !== 'undefined') {
804
3873
  // Indicate to webpack that this file can be concatenated
805
3874
  /* harmony default export */ var setPublicPath = (null);
806
3875
 
807
- // CONCATENATED MODULE: ./node_modules/cache-loader/dist/cjs.js?{"cacheDirectory":"node_modules/.cache/vue-loader","cacheIdentifier":"0d18a846-vue-loader-template"}!./node_modules/vue-loader/lib/loaders/templateLoader.js??vue-loader-options!./node_modules/cache-loader/dist/cjs.js??ref--0-0!./node_modules/vue-loader/lib??vue-loader-options!./src/components/SideBar.vue?vue&type=template&id=313390a9&scoped=true&
3876
+ // CONCATENATED MODULE: ./node_modules/cache-loader/dist/cjs.js?{"cacheDirectory":"node_modules/.cache/vue-loader","cacheIdentifier":"590ce1ae-vue-loader-template"}!./node_modules/vue-loader/lib/loaders/templateLoader.js??vue-loader-options!./node_modules/cache-loader/dist/cjs.js??ref--0-0!./node_modules/vue-loader/lib??vue-loader-options!./src/components/SideBar.vue?vue&type=template&id=313390a9&scoped=true&
808
3877
  var render = function () {var _vm=this;var _h=_vm.$createElement;var _c=_vm._self._c||_h;return _c('div',{ref:"container"},[(!_vm.drawerOpen)?_c('div',{staticClass:"open-tab",on:{"click":_vm.toggleDrawer}},[_c('i',{staticClass:"el-icon-arrow-left"})]):_vm._e(),_c('el-drawer',{staticClass:"side-bar",attrs:{"custom-class":"my-drawer","visible":_vm.drawerOpen,"appendToBody":false,"modal-append-to-body":false,"size":"550","with-header":false,"wrapperClosable":false,"modal":false},on:{"update:visible":function($event){_vm.drawerOpen=$event}}},[_c('div',{staticClass:"box-card"},[(_vm.drawerOpen)?_c('div',{staticClass:"close-tab",on:{"click":_vm.close}},[_c('i',{staticClass:"el-icon-arrow-right"})]):_vm._e(),_c('div',{staticClass:"sidebar-container"},[(_vm.tabs.length > 1)?_c('tabs',{attrs:{"tabTitles":_vm.tabs,"activeId":_vm.activeId},on:{"titleClicked":_vm.tabClicked}}):_vm._e(),_vm._l((_vm.tabs),function(tab){return [_c('sidebar-content',{directives:[{name:"show",rawName:"v-show",value:(tab.id===_vm.activeId),expression:"tab.id===activeId"}],key:tab.id,ref:tab.id,refInFor:true,staticClass:"sidebar-content-container",attrs:{"contextCardEntry":tab.contextCard,"envVars":_vm.envVars},on:{"search-changed":function($event){return _vm.searchChanged(tab.id, $event)}}})]})],2)])])],1)}
809
3878
  var staticRenderFns = []
810
3879
 
@@ -879,7 +3948,7 @@ var en_default = /*#__PURE__*/__webpack_require__.n(en_);
879
3948
  var locale_ = __webpack_require__("7f9f");
880
3949
  var locale_default = /*#__PURE__*/__webpack_require__.n(locale_);
881
3950
 
882
- // CONCATENATED MODULE: ./node_modules/cache-loader/dist/cjs.js?{"cacheDirectory":"node_modules/.cache/vue-loader","cacheIdentifier":"0d18a846-vue-loader-template"}!./node_modules/vue-loader/lib/loaders/templateLoader.js??vue-loader-options!./node_modules/cache-loader/dist/cjs.js??ref--0-0!./node_modules/vue-loader/lib??vue-loader-options!./src/components/SidebarContent.vue?vue&type=template&id=13cf0a2e&scoped=true&
3951
+ // CONCATENATED MODULE: ./node_modules/cache-loader/dist/cjs.js?{"cacheDirectory":"node_modules/.cache/vue-loader","cacheIdentifier":"590ce1ae-vue-loader-template"}!./node_modules/vue-loader/lib/loaders/templateLoader.js??vue-loader-options!./node_modules/cache-loader/dist/cjs.js??ref--0-0!./node_modules/vue-loader/lib??vue-loader-options!./src/components/SidebarContent.vue?vue&type=template&id=13cf0a2e&scoped=true&
883
3952
  var SidebarContentvue_type_template_id_13cf0a2e_scoped_true_render = function () {var _vm=this;var _h=_vm.$createElement;var _c=_vm._self._c||_h;return _c('el-card',{staticClass:"content-card",attrs:{"body-style":_vm.bodyStyle}},[_c('div',{staticClass:"header",attrs:{"slot":"header"},slot:"header"},[(_vm.contextCardEntry && _vm.contextCardEnabled)?_c('context-card',{attrs:{"entry":_vm.contextCardEntry,"envVars":_vm.envVars}}):_vm._e(),_c('el-input',{staticClass:"search-input",attrs:{"placeholder":"Search","clearable":""},on:{"clear":_vm.clearSearchClicked},nativeOn:{"keyup":function($event){return _vm.searchEvent($event)}},model:{value:(_vm.searchInput),callback:function ($$v) {_vm.searchInput=$$v},expression:"searchInput"}}),_c('el-button',{staticClass:"button",on:{"click":_vm.searchEvent}},[_vm._v("Search")])],1),_c('SearchFilters',{ref:"filtersRef",staticClass:"filters",attrs:{"entry":_vm.filterEntry,"envVars":_vm.envVars},on:{"filterResults":_vm.filterUpdate,"numberPerPage":_vm.numberPerPageUpdate,"loading":_vm.filtersLoading,"cascaderReady":_vm.cascaderReady}}),_c('div',{directives:[{name:"loading",rawName:"v-loading",value:(_vm.loadingCards),expression:"loadingCards"}],ref:"content",staticClass:"content scrollbar"},[(_vm.results.length === 0 && !_vm.loadingCards)?_c('div',{staticClass:"error-feedback"},[_vm._v("No results found - Please change your search / filter criteria.")]):_vm._e(),_vm._l((_vm.results),function(result){return _c('div',{key:result.doi,staticClass:"step-item"},[_c('DatasetCard',{attrs:{"entry":result,"envVars":_vm.envVars},on:{"contextUpdate":_vm.contextCardUpdate}})],1)}),_c('el-pagination',{staticClass:"pagination",attrs:{"current-page":_vm.page,"hide-on-single-page":"","large":"","layout":"prev, pager, next","page-size":_vm.numberPerPage,"total":_vm.numberOfHits},on:{"update:currentPage":function($event){_vm.page=$event},"update:current-page":function($event){_vm.page=$event},"current-change":_vm.pageChange}})],2)],1)}
884
3953
  var SidebarContentvue_type_template_id_13cf0a2e_scoped_true_staticRenderFns = []
885
3954
 
@@ -1060,7 +4129,7 @@ var button_css_ = __webpack_require__("26bc");
1060
4129
  var button_ = __webpack_require__("5d8c");
1061
4130
  var button_default = /*#__PURE__*/__webpack_require__.n(button_);
1062
4131
 
1063
- // CONCATENATED MODULE: ./node_modules/cache-loader/dist/cjs.js?{"cacheDirectory":"node_modules/.cache/vue-loader","cacheIdentifier":"0d18a846-vue-loader-template"}!./node_modules/vue-loader/lib/loaders/templateLoader.js??vue-loader-options!./node_modules/cache-loader/dist/cjs.js??ref--0-0!./node_modules/vue-loader/lib??vue-loader-options!./src/components/SearchFilters.vue?vue&type=template&id=7f7ea160&scoped=true&
4132
+ // CONCATENATED MODULE: ./node_modules/cache-loader/dist/cjs.js?{"cacheDirectory":"node_modules/.cache/vue-loader","cacheIdentifier":"590ce1ae-vue-loader-template"}!./node_modules/vue-loader/lib/loaders/templateLoader.js??vue-loader-options!./node_modules/cache-loader/dist/cjs.js??ref--0-0!./node_modules/vue-loader/lib??vue-loader-options!./src/components/SearchFilters.vue?vue&type=template&id=7f7ea160&scoped=true&
1064
4133
  var SearchFiltersvue_type_template_id_7f7ea160_scoped_true_render = function () {var _vm=this;var _h=_vm.$createElement;var _c=_vm._self._c||_h;return _c('div',{staticClass:"filters"},[_c('map-svg-sprite-color'),_c('transition',{attrs:{"name":"el-zoom-in-top"}},[_c('span',{directives:[{name:"show",rawName:"v-show",value:(_vm.showFilters),expression:"showFilters"}],staticClass:"search-filters transition-box"},[_c('custom-cascader',{ref:"cascader",staticClass:"cascader",attrs:{"placeholder":"","collapse-tags":true,"options":_vm.options,"props":_vm.props,"show-all-levels":false,"append-to-body":false},on:{"change":function($event){return _vm.cascadeEvent($event)},"expand-change":_vm.cascadeExpandChange,"tags-changed":_vm.tagsChangedCallback},model:{value:(_vm.cascadeSelected),callback:function ($$v) {_vm.cascadeSelected=$$v},expression:"cascadeSelected"}}),(_vm.showFiltersText)?_c('div',{staticClass:"filter-default-value"},[_vm._v(" Filters ")]):_vm._e(),_c('el-popover',{attrs:{"title":"How do filters work?","width":"250","trigger":"hover","append-to-body":false,"popper-class":"popover"}},[_c('map-svg-icon',{staticClass:"help",attrs:{"slot":"reference","icon":"help"},slot:"reference"}),_c('div',[_c('strong',[_vm._v("Within categories:")]),_vm._v(" OR "),_c('br'),_vm._v(" example: 'heart' OR 'colon' "),_c('br'),_c('br'),_c('strong',[_vm._v("Between categories:")]),_vm._v(" AND "),_c('br'),_vm._v(" example: 'rat' AND 'lung' ")])],1)],1)]),_c('el-select',{staticClass:"number-shown-select",attrs:{"placeholder":"10"},on:{"change":function($event){return _vm.numberShownChanged($event)}},model:{value:(_vm.numberShown),callback:function ($$v) {_vm.numberShown=$$v},expression:"numberShown"}},_vm._l((_vm.numberDatasetsShown),function(item){return _c('el-option',{key:item,attrs:{"label":item,"value":item}})}),1),_c('span',{staticClass:"dataset-results-feedback"},[_vm._v(_vm._s(this.numberOfResultsText))])],1)}
1065
4134
  var SearchFiltersvue_type_template_id_7f7ea160_scoped_true_staticRenderFns = []
1066
4135
 
@@ -2265,14 +5334,14 @@ var SearchFilters_component = normalizeComponent(
2265
5334
  )
2266
5335
 
2267
5336
  /* harmony default export */ var SearchFilters = (SearchFilters_component.exports);
2268
- // CONCATENATED MODULE: ./node_modules/cache-loader/dist/cjs.js?{"cacheDirectory":"node_modules/.cache/vue-loader","cacheIdentifier":"0d18a846-vue-loader-template"}!./node_modules/vue-loader/lib/loaders/templateLoader.js??vue-loader-options!./node_modules/cache-loader/dist/cjs.js??ref--0-0!./node_modules/vue-loader/lib??vue-loader-options!./src/components/DatasetCard.vue?vue&type=template&id=bf193158&scoped=true&
5337
+ // CONCATENATED MODULE: ./node_modules/cache-loader/dist/cjs.js?{"cacheDirectory":"node_modules/.cache/vue-loader","cacheIdentifier":"590ce1ae-vue-loader-template"}!./node_modules/vue-loader/lib/loaders/templateLoader.js??vue-loader-options!./node_modules/cache-loader/dist/cjs.js??ref--0-0!./node_modules/vue-loader/lib??vue-loader-options!./src/components/DatasetCard.vue?vue&type=template&id=bf193158&scoped=true&
2269
5338
  var DatasetCardvue_type_template_id_bf193158_scoped_true_render = function () {var _vm=this;var _h=_vm.$createElement;var _c=_vm._self._c||_h;return _c('div',{ref:"container",staticClass:"dataset-card-container"},[_c('div',{ref:"card",staticClass:"dataset-card"},[_c('div',{staticClass:"seperator-path"}),_c('div',{directives:[{name:"loading",rawName:"v-loading",value:(_vm.loading),expression:"loading"}],staticClass:"card"},[_c('span',{staticClass:"card-left"},[(!_vm.loading && _vm.discoverId)?_c('image-gallery',{attrs:{"datasetId":_vm.discoverId,"datasetVersion":_vm.version,"entry":_vm.entry,"envVars":_vm.envVars,"label":_vm.label,"datasetThumbnail":_vm.thumbnail,"dataset-biolucida":_vm.biolucidaData,"category":_vm.currentCategory},on:{"card-clicked":_vm.galleryClicked}}):_vm._e()],1),_c('div',{staticClass:"card-right"},[_c('div',{staticClass:"title",on:{"click":_vm.cardClicked}},[_vm._v(_vm._s(_vm.entry.name))]),_c('div',{staticClass:"details"},[_vm._v(_vm._s(_vm.contributors)+" "+_vm._s(_vm.entry.publishDate ? ("(" + _vm.publishYear + ")") : ''))]),_c('div',{staticClass:"details"},[_vm._v(_vm._s(_vm.samples))]),(!_vm.entry.detailsReady)?_c('div',{directives:[{name:"loading",rawName:"v-loading",value:(!_vm.entry.detailsReady),expression:"!entry.detailsReady"}],staticClass:"details loading-icon"}):_vm._e(),_c('div',[(_vm.entry.simulation)?_c('el-button',{staticClass:"button",attrs:{"size":"mini","icon":"el-icon-view"},on:{"click":_vm.openRepository}},[_vm._v("View repository")]):_vm._e()],1),_c('div',{staticClass:"badges-container"},[_c('badges-group',{attrs:{"entry":_vm.entry,"dataset-biolucida":_vm.biolucidaData},on:{"categoryChanged":_vm.categoryChanged}})],1)])])])])}
2270
5339
  var DatasetCardvue_type_template_id_bf193158_scoped_true_staticRenderFns = []
2271
5340
 
2272
5341
 
2273
5342
  // CONCATENATED MODULE: ./src/components/DatasetCard.vue?vue&type=template&id=bf193158&scoped=true&
2274
5343
 
2275
- // CONCATENATED MODULE: ./node_modules/cache-loader/dist/cjs.js?{"cacheDirectory":"node_modules/.cache/vue-loader","cacheIdentifier":"0d18a846-vue-loader-template"}!./node_modules/vue-loader/lib/loaders/templateLoader.js??vue-loader-options!./node_modules/cache-loader/dist/cjs.js??ref--0-0!./node_modules/vue-loader/lib??vue-loader-options!./src/components/BadgesGroup.vue?vue&type=template&id=712c1be9&scoped=true&
5344
+ // CONCATENATED MODULE: ./node_modules/cache-loader/dist/cjs.js?{"cacheDirectory":"node_modules/.cache/vue-loader","cacheIdentifier":"590ce1ae-vue-loader-template"}!./node_modules/vue-loader/lib/loaders/templateLoader.js??vue-loader-options!./node_modules/cache-loader/dist/cjs.js??ref--0-0!./node_modules/vue-loader/lib??vue-loader-options!./src/components/BadgesGroup.vue?vue&type=template&id=712c1be9&scoped=true&
2276
5345
  var BadgesGroupvue_type_template_id_712c1be9_scoped_true_render = function () {var _vm=this;var _h=_vm.$createElement;var _c=_vm._self._c||_h;return (_vm.categories['All'].size > 1)?_c('div',{ref:"container",staticClass:"container"},[_c('div',[_vm._v(" View data types: ")]),_vm._l((_vm.categories),function(item,key){return [(item.size > 0)?_c('el-button',{key:key,class:[{ 'active': key == _vm.active},'tag-button'],attrs:{"size":"small"},on:{"click":function($event){return _vm.categoryClicked(key)}}},[_vm._v(_vm._s(key + " (" + item.size + ")")+" ")]):_vm._e()]})],2):_vm._e()}
2277
5346
  var BadgesGroupvue_type_template_id_712c1be9_scoped_true_staticRenderFns = []
2278
5347
 
@@ -2422,7 +5491,7 @@ var BadgesGroup_component = normalizeComponent(
2422
5491
 
2423
5492
  var EventBus = new external_vue_default.a();
2424
5493
  /* harmony default export */ var components_EventBus = (EventBus);
2425
- // CONCATENATED MODULE: ./node_modules/cache-loader/dist/cjs.js?{"cacheDirectory":"node_modules/.cache/vue-loader","cacheIdentifier":"0d18a846-vue-loader-template"}!./node_modules/vue-loader/lib/loaders/templateLoader.js??vue-loader-options!./node_modules/cache-loader/dist/cjs.js??ref--0-0!./node_modules/vue-loader/lib??vue-loader-options!./src/components/ImageGallery.vue?vue&type=template&id=c336c3ca&scoped=true&
5494
+ // CONCATENATED MODULE: ./node_modules/cache-loader/dist/cjs.js?{"cacheDirectory":"node_modules/.cache/vue-loader","cacheIdentifier":"590ce1ae-vue-loader-template"}!./node_modules/vue-loader/lib/loaders/templateLoader.js??vue-loader-options!./node_modules/cache-loader/dist/cjs.js??ref--0-0!./node_modules/vue-loader/lib??vue-loader-options!./src/components/ImageGallery.vue?vue&type=template&id=c336c3ca&scoped=true&
2426
5495
  var ImageGalleryvue_type_template_id_c336c3ca_scoped_true_render = function () {var _vm=this;var _h=_vm.$createElement;var _c=_vm._self._c||_h;return _c('div',{staticClass:"full-size"},[_c('gallery',{ref:"gallery",attrs:{"bottomSpacer":_vm.bottomSpacer,"cardWidth":10,"items":_vm.galleryItems,"max-width":_vm.maxWidth,"show-indicator-bar":false,"show-card-details":true,"highlight-active":false,"image-style":_vm.imageStyle,"image-container-style":_vm.imageContainerStyle,"body-style":_vm.bodyStyle,"shadow":_vm.shadow},on:{"card-clicked":_vm.cardClicked}})],1)}
2427
5496
  var ImageGalleryvue_type_template_id_c336c3ca_scoped_true_staticRenderFns = []
2428
5497
 
@@ -3278,7 +6347,7 @@ var DatasetCard_component = normalizeComponent(
3278
6347
  )
3279
6348
 
3280
6349
  /* harmony default export */ var DatasetCard = (DatasetCard_component.exports);
3281
- // CONCATENATED MODULE: ./node_modules/cache-loader/dist/cjs.js?{"cacheDirectory":"node_modules/.cache/vue-loader","cacheIdentifier":"0d18a846-vue-loader-template"}!./node_modules/vue-loader/lib/loaders/templateLoader.js??vue-loader-options!./node_modules/cache-loader/dist/cjs.js??ref--0-0!./node_modules/vue-loader/lib??vue-loader-options!./src/components/ContextCard.vue?vue&type=template&id=2d699d90&scoped=true&
6350
+ // CONCATENATED MODULE: ./node_modules/cache-loader/dist/cjs.js?{"cacheDirectory":"node_modules/.cache/vue-loader","cacheIdentifier":"590ce1ae-vue-loader-template"}!./node_modules/vue-loader/lib/loaders/templateLoader.js??vue-loader-options!./node_modules/cache-loader/dist/cjs.js??ref--0-0!./node_modules/vue-loader/lib??vue-loader-options!./src/components/ContextCard.vue?vue&type=template&id=2d699d90&scoped=true&
3282
6351
  var ContextCardvue_type_template_id_2d699d90_scoped_true_render = function () {var _vm=this;var _h=_vm.$createElement;var _c=_vm._self._c||_h;return _c('div',{ref:"container",staticClass:"context-card-container"},[_c('div',{directives:[{name:"show",rawName:"v-show",value:(_vm.showContextCard),expression:"showContextCard"}]},[_c('div',{directives:[{name:"show",rawName:"v-show",value:(_vm.showDetails),expression:"showDetails"}],staticClass:"hide",on:{"click":function($event){_vm.showDetails = !_vm.showDetails}}},[_vm._v("Hide information"),_c('i',{staticClass:"el-icon-arrow-up"})]),_c('div',{directives:[{name:"show",rawName:"v-show",value:(!_vm.showDetails),expression:"!showDetails"}],staticClass:"hide",on:{"click":function($event){_vm.showDetails = !_vm.showDetails}}},[_vm._v("Show information"),_c('i',{staticClass:"el-icon-arrow-down"})]),(_vm.showDetails && Object.keys(_vm.contextData).length !== 0)?_c('el-card',{directives:[{name:"loading",rawName:"v-loading",value:(_vm.loading),expression:"loading"}],staticClass:"context-card"},[_c('div',{staticClass:"card-left"},[_c('img',{staticClass:"context-image",attrs:{"src":_vm.banner}})]),_c('div',{staticClass:"card-right scrollbar"},[_c('div',{staticClass:"title"},[_vm._v(_vm._s(_vm.contextData.heading))]),_c('div',{domProps:{"innerHTML":_vm._s(_vm.parseMarkdown(_vm.contextData.description))}}),_c('br'),(!_vm.samplesUnderViews)?[(_vm.contextData.views && _vm.contextData.views.length > 0)?_c('div',{staticClass:"subtitle"},[_vm._v("Scaffold Views")]):_vm._e(),_vm._l((_vm.contextData.views),function(view,i){return [_c('div',{key:i+'_1',staticClass:"context-card-view",on:{"click":function($event){return _vm.openViewFile(view)}}},[_c('img',{staticClass:"view-image",attrs:{"src":_vm.getFileFromPath(view.thumbnail)}}),_c('div',{staticClass:"view-description"},[_vm._v(_vm._s(view.description))])]),_c('div',{key:i,staticClass:"padding"})]}),_c('div',{staticStyle:{"margin-bottom":"16px"}}),(_vm.contextData.samples && _vm.contextData.samples.length > 0)?_c('div',{staticClass:"subtitle"},[_vm._v("Samples on Scaffold")]):_vm._e(),_vm._l((_vm.contextData.samples),function(sample,i){return [_c('span',{key:i+'_3',staticClass:"context-card-item cursor-pointer",on:{"click":function($event){return _vm.toggleSampleDetails(i)}}},[_c('div',{key:i+'_6',staticStyle:{"display":"flex"}},[(sample.color)?_c('div',{staticClass:"color-box",style:('background-color:'+ sample.color)}):(sample.thumbnail)?_c('img',{staticClass:"key-image",attrs:{"src":_vm.getFileFromPath(sample.thumbnail)}}):_vm._e(),_vm._v(" "+_vm._s(sample.heading)+" "),_c('i',{staticClass:"el-icon-warning-outline info"})])]),(_vm.sampleDetails[i])?_c('div',{key:i+'_4',domProps:{"innerHTML":_vm._s(sample.description)}}):_vm._e(),(_vm.sampleDetails[i] && sample.path)?_c('a',{key:i+'_5',attrs:{"href":_vm.generateFileLink(sample),"target":"_blank"}},[_vm._v("View Source")]):_vm._e(),_c('div',{key:i+'_2',staticClass:"padding"})]})]:[(_vm.contextData.views && _vm.contextData.views.length > 0)?_c('div',{staticClass:"subtitle"},[_vm._v("Scaffold Views")]):_vm._e(),_vm._l((_vm.contextData.views),function(view,i){return [_c('span',{key:i+'_1',staticClass:"context-card-view",on:{"click":function($event){return _vm.viewClicked(view, i)}}},[_c('img',{staticClass:"view-image",attrs:{"src":_vm.getFileFromPath(view.thumbnail)}}),_c('div',{staticClass:"view-description"},[_vm._v(_vm._s(view.description)),_c('i',{staticClass:"el-icon-warning-outline info"})])]),(_vm.sampleDetails[i])?_c('div',{key:i+'_2',domProps:{"innerHTML":_vm._s(_vm.samplesMatching(view.id).description)}}):_vm._e(),(_vm.sampleDetails[i] && _vm.samplesMatching(view.id).path)?_c('a',{key:i+'_5',attrs:{"href":_vm.generateFileLink(_vm.samplesMatching(view.id)),"target":"_blank"}},[_vm._v("View Source")]):_vm._e(),_c('div',{key:i,staticClass:"padding"}),(_vm.sampleDetails[i])?_c('div',{key:i+'_6',staticClass:"padding"}):_vm._e()]})]],2)]):_vm._e()],1)])}
3283
6352
  var ContextCardvue_type_template_id_2d699d90_scoped_true_staticRenderFns = []
3284
6353
 
@@ -3370,8 +6439,8 @@ var link_default = /*#__PURE__*/__webpack_require__.n(link_);
3370
6439
  // ]
3371
6440
  // }
3372
6441
  // }
3373
- // EXTERNAL MODULE: external "marked"
3374
- var external_marked_ = __webpack_require__("1d61");
6442
+ // EXTERNAL MODULE: ./node_modules/marked/lib/marked.umd.js
6443
+ var marked_umd = __webpack_require__("7c5c");
3375
6444
 
3376
6445
  // EXTERNAL MODULE: external "xss"
3377
6446
  var external_xss_ = __webpack_require__("efde");
@@ -3672,7 +6741,7 @@ var convertBackslashToForwardSlash = function convertBackslashToForwardSlash(pat
3672
6741
  return "".concat(this.envVars.ROOT_URL, "/file/").concat(sample.discoverId, "/").concat(sample.version, "?path=").concat(this.processPathForUrl(sample.path));
3673
6742
  },
3674
6743
  parseMarkdown: function parseMarkdown(markdown) {
3675
- return external_xss_default()(external_marked_["marked"].parse(markdown));
6744
+ return external_xss_default()(marked_umd["marked"].parse(markdown));
3676
6745
  },
3677
6746
  openViewFile: function openViewFile(view) {
3678
6747
  // note that we assume that the view file is in the same directory as the scaffold (viewUrls take relative paths)
@@ -4241,7 +7310,7 @@ var SidebarContent_component = normalizeComponent(
4241
7310
  )
4242
7311
 
4243
7312
  /* harmony default export */ var SidebarContent = (SidebarContent_component.exports);
4244
- // CONCATENATED MODULE: ./node_modules/cache-loader/dist/cjs.js?{"cacheDirectory":"node_modules/.cache/vue-loader","cacheIdentifier":"0d18a846-vue-loader-template"}!./node_modules/vue-loader/lib/loaders/templateLoader.js??vue-loader-options!./node_modules/cache-loader/dist/cjs.js??ref--0-0!./node_modules/vue-loader/lib??vue-loader-options!./src/components/Tabs.vue?vue&type=template&id=d68260c4&scoped=true&
7313
+ // CONCATENATED MODULE: ./node_modules/cache-loader/dist/cjs.js?{"cacheDirectory":"node_modules/.cache/vue-loader","cacheIdentifier":"590ce1ae-vue-loader-template"}!./node_modules/vue-loader/lib/loaders/templateLoader.js??vue-loader-options!./node_modules/cache-loader/dist/cjs.js??ref--0-0!./node_modules/vue-loader/lib??vue-loader-options!./src/components/Tabs.vue?vue&type=template&id=d68260c4&scoped=true&
4245
7314
  var Tabsvue_type_template_id_d68260c4_scoped_true_render = function () {var _vm=this;var _h=_vm.$createElement;var _c=_vm._self._c||_h;return _c('div',{staticClass:"tab-container"},_vm._l((_vm.tabTitles),function(title){return _c('div',{key:title.id,staticClass:"title"},[_c('div',{staticClass:"title-text-table",class:{ highlightText : (title.id==_vm.activeId) },on:{"click":function($event){return _vm.titleClicked(title.id)}}},[_c('div',{staticClass:"title-text"},[_vm._v(" "+_vm._s(title.title)+" ")])])])}),0)}
4246
7315
  var Tabsvue_type_template_id_d68260c4_scoped_true_staticRenderFns = []
4247
7316