@uiw/react-md-editor 3.9.4 → 3.9.5
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/mdeditor.css +19 -0
- package/dist/mdeditor.js +232 -553
- package/dist/mdeditor.min.css +1 -1
- package/dist/mdeditor.min.js +1 -1
- package/package.json +2 -2
package/dist/mdeditor.js
CHANGED
|
@@ -35077,6 +35077,39 @@ function _nonIterableSpread() {
|
|
|
35077
35077
|
function _toConsumableArray(arr) {
|
|
35078
35078
|
return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _unsupportedIterableToArray(arr) || _nonIterableSpread();
|
|
35079
35079
|
}
|
|
35080
|
+
;// CONCATENATED MODULE: ./node_modules/@uiw/react-markdown-preview/node_modules/@babel/runtime/helpers/esm/objectWithoutPropertiesLoose.js
|
|
35081
|
+
function objectWithoutPropertiesLoose_objectWithoutPropertiesLoose(source, excluded) {
|
|
35082
|
+
if (source == null) return {};
|
|
35083
|
+
var target = {};
|
|
35084
|
+
var sourceKeys = Object.keys(source);
|
|
35085
|
+
var key, i;
|
|
35086
|
+
|
|
35087
|
+
for (i = 0; i < sourceKeys.length; i++) {
|
|
35088
|
+
key = sourceKeys[i];
|
|
35089
|
+
if (excluded.indexOf(key) >= 0) continue;
|
|
35090
|
+
target[key] = source[key];
|
|
35091
|
+
}
|
|
35092
|
+
|
|
35093
|
+
return target;
|
|
35094
|
+
}
|
|
35095
|
+
;// CONCATENATED MODULE: ./node_modules/@uiw/react-markdown-preview/node_modules/@babel/runtime/helpers/esm/extends.js
|
|
35096
|
+
function extends_extends() {
|
|
35097
|
+
extends_extends = Object.assign || function (target) {
|
|
35098
|
+
for (var i = 1; i < arguments.length; i++) {
|
|
35099
|
+
var source = arguments[i];
|
|
35100
|
+
|
|
35101
|
+
for (var key in source) {
|
|
35102
|
+
if (Object.prototype.hasOwnProperty.call(source, key)) {
|
|
35103
|
+
target[key] = source[key];
|
|
35104
|
+
}
|
|
35105
|
+
}
|
|
35106
|
+
}
|
|
35107
|
+
|
|
35108
|
+
return target;
|
|
35109
|
+
};
|
|
35110
|
+
|
|
35111
|
+
return extends_extends.apply(this, arguments);
|
|
35112
|
+
}
|
|
35080
35113
|
;// CONCATENATED MODULE: ./node_modules/@babel/runtime/helpers/esm/classCallCheck.js
|
|
35081
35114
|
function _classCallCheck(instance, Constructor) {
|
|
35082
35115
|
if (!(instance instanceof Constructor)) {
|
|
@@ -52477,23 +52510,99 @@ function association(node) {
|
|
|
52477
52510
|
|
|
52478
52511
|
return decodeString(node.identifier);
|
|
52479
52512
|
}
|
|
52513
|
+
;// CONCATENATED MODULE: ./node_modules/mdast-util-to-markdown/lib/util/track.js
|
|
52514
|
+
/**
|
|
52515
|
+
* @typedef {import('unist').Point} Point
|
|
52516
|
+
* @typedef {import('../types.js').TrackFields} TrackFields
|
|
52517
|
+
*/
|
|
52518
|
+
|
|
52519
|
+
/**
|
|
52520
|
+
* Functions to track output positions.
|
|
52521
|
+
* This info isn’t used yet but suchs functionality allows line wrapping,
|
|
52522
|
+
* and theoretically source maps (though, is there practical use in that?).
|
|
52523
|
+
*
|
|
52524
|
+
* @param {TrackFields} options_
|
|
52525
|
+
*/
|
|
52526
|
+
function track(options_) {
|
|
52527
|
+
// Defaults are used to prevent crashes when older utilities somehow activate
|
|
52528
|
+
// this code.
|
|
52529
|
+
|
|
52530
|
+
/* c8 ignore next 5 */
|
|
52531
|
+
var options = options_ || {};
|
|
52532
|
+
var now = options.now || {};
|
|
52533
|
+
var lineShift = options.lineShift || 0;
|
|
52534
|
+
var line = now.line || 1;
|
|
52535
|
+
var column = now.column || 1;
|
|
52536
|
+
return {
|
|
52537
|
+
move: move,
|
|
52538
|
+
current: current,
|
|
52539
|
+
shift: shift
|
|
52540
|
+
};
|
|
52541
|
+
/**
|
|
52542
|
+
* Get the current tracked info.
|
|
52543
|
+
*
|
|
52544
|
+
* @returns {{now: Point, lineShift: number}}
|
|
52545
|
+
*/
|
|
52546
|
+
|
|
52547
|
+
function current() {
|
|
52548
|
+
return {
|
|
52549
|
+
now: {
|
|
52550
|
+
line: line,
|
|
52551
|
+
column: column
|
|
52552
|
+
},
|
|
52553
|
+
lineShift: lineShift
|
|
52554
|
+
};
|
|
52555
|
+
}
|
|
52556
|
+
/**
|
|
52557
|
+
* Define an increased line shift (the typical indent for lines).
|
|
52558
|
+
*
|
|
52559
|
+
* @param {number} value
|
|
52560
|
+
*/
|
|
52561
|
+
|
|
52562
|
+
|
|
52563
|
+
function shift(value) {
|
|
52564
|
+
lineShift += value;
|
|
52565
|
+
}
|
|
52566
|
+
/**
|
|
52567
|
+
* Move past a string.
|
|
52568
|
+
*
|
|
52569
|
+
* @param {string} value
|
|
52570
|
+
* @returns {string}
|
|
52571
|
+
*/
|
|
52572
|
+
|
|
52573
|
+
|
|
52574
|
+
function move() {
|
|
52575
|
+
var value = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : '';
|
|
52576
|
+
var chunks = value.split(/\r?\n|\r/g);
|
|
52577
|
+
var tail = chunks[chunks.length - 1];
|
|
52578
|
+
line += chunks.length - 1;
|
|
52579
|
+
column = chunks.length === 1 ? column + tail.length : 1 + tail.length + lineShift;
|
|
52580
|
+
return value;
|
|
52581
|
+
}
|
|
52582
|
+
}
|
|
52480
52583
|
;// CONCATENATED MODULE: ./node_modules/mdast-util-to-markdown/lib/util/container-flow.js
|
|
52584
|
+
|
|
52585
|
+
|
|
52481
52586
|
/**
|
|
52482
52587
|
* @typedef {import('../types.js').Node} Node
|
|
52483
52588
|
* @typedef {import('../types.js').Parent} Parent
|
|
52484
52589
|
* @typedef {import('../types.js').Join} Join
|
|
52485
52590
|
* @typedef {import('../types.js').Context} Context
|
|
52591
|
+
* @typedef {import('../types.js').TrackFields} TrackFields
|
|
52486
52592
|
*/
|
|
52487
52593
|
|
|
52488
52594
|
/**
|
|
52489
52595
|
* @param {Parent} parent
|
|
52490
52596
|
* @param {Context} context
|
|
52597
|
+
* @param {TrackFields} safeOptions
|
|
52491
52598
|
* @returns {string}
|
|
52492
52599
|
*/
|
|
52493
|
-
|
|
52600
|
+
|
|
52601
|
+
function containerFlow(parent, context, safeOptions) {
|
|
52494
52602
|
var indexStack = context.indexStack;
|
|
52495
52603
|
var children = parent.children || [];
|
|
52496
|
-
|
|
52604
|
+
var tracker = track(safeOptions);
|
|
52605
|
+
/** @type {Array<string>} */
|
|
52497
52606
|
|
|
52498
52607
|
var results = [];
|
|
52499
52608
|
var index = -1;
|
|
@@ -52502,17 +52611,17 @@ function containerFlow(parent, context) {
|
|
|
52502
52611
|
while (++index < children.length) {
|
|
52503
52612
|
var child = children[index];
|
|
52504
52613
|
indexStack[indexStack.length - 1] = index;
|
|
52505
|
-
results.push(context.handle(child, parent, context, {
|
|
52614
|
+
results.push(tracker.move(context.handle(child, parent, context, _objectSpread2({
|
|
52506
52615
|
before: '\n',
|
|
52507
52616
|
after: '\n'
|
|
52508
|
-
}));
|
|
52617
|
+
}, tracker.current()))));
|
|
52509
52618
|
|
|
52510
52619
|
if (child.type !== 'list') {
|
|
52511
52620
|
context.bulletLastUsed = undefined;
|
|
52512
52621
|
}
|
|
52513
52622
|
|
|
52514
52623
|
if (index < children.length - 1) {
|
|
52515
|
-
results.push(between(child, children[index + 1]));
|
|
52624
|
+
results.push(tracker.move(between(child, children[index + 1])));
|
|
52516
52625
|
}
|
|
52517
52626
|
}
|
|
52518
52627
|
|
|
@@ -52562,7 +52671,7 @@ var eol = /\r?\n|\r/g;
|
|
|
52562
52671
|
*/
|
|
52563
52672
|
|
|
52564
52673
|
function indentLines(value, map) {
|
|
52565
|
-
/** @type {Array
|
|
52674
|
+
/** @type {Array<string>} */
|
|
52566
52675
|
var result = [];
|
|
52567
52676
|
var start = 0;
|
|
52568
52677
|
var line = 0;
|
|
@@ -52610,7 +52719,7 @@ function patternCompile(pattern) {
|
|
|
52610
52719
|
*/
|
|
52611
52720
|
|
|
52612
52721
|
/**
|
|
52613
|
-
* @param {Array
|
|
52722
|
+
* @param {Array<string>} stack
|
|
52614
52723
|
* @param {Unsafe} pattern
|
|
52615
52724
|
* @returns {boolean}
|
|
52616
52725
|
*/
|
|
@@ -52618,7 +52727,7 @@ function patternInScope(stack, pattern) {
|
|
|
52618
52727
|
return listInScope(stack, pattern.inConstruct, true) && !listInScope(stack, pattern.notInConstruct, false);
|
|
52619
52728
|
}
|
|
52620
52729
|
/**
|
|
52621
|
-
* @param {Array
|
|
52730
|
+
* @param {Array<string>} stack
|
|
52622
52731
|
* @param {Unsafe['inConstruct']} list
|
|
52623
52732
|
* @param {boolean} none
|
|
52624
52733
|
* @returns {boolean}
|
|
@@ -52653,16 +52762,16 @@ function listInScope(stack, list, none) {
|
|
|
52653
52762
|
/**
|
|
52654
52763
|
* @param {Context} context
|
|
52655
52764
|
* @param {string|null|undefined} input
|
|
52656
|
-
* @param {SafeOptions & {encode?: Array
|
|
52765
|
+
* @param {SafeOptions & {encode?: Array<string>}} config
|
|
52657
52766
|
* @returns {string}
|
|
52658
52767
|
*/
|
|
52659
52768
|
|
|
52660
52769
|
function safe(context, input, config) {
|
|
52661
52770
|
var value = (config.before || '') + (input || '') + (config.after || '');
|
|
52662
|
-
/** @type {Array
|
|
52771
|
+
/** @type {Array<number>} */
|
|
52663
52772
|
|
|
52664
52773
|
var positions = [];
|
|
52665
|
-
/** @type {Array
|
|
52774
|
+
/** @type {Array<string>} */
|
|
52666
52775
|
|
|
52667
52776
|
var result = [];
|
|
52668
52777
|
/** @type {Record<number, {before: boolean, after: boolean}>} */
|
|
@@ -52764,10 +52873,10 @@ function numerical(a, b) {
|
|
|
52764
52873
|
|
|
52765
52874
|
function escapeBackslashes(value, after) {
|
|
52766
52875
|
var expression = /\\(?=[!-/:-@[-`{-~])/g;
|
|
52767
|
-
/** @type {Array
|
|
52876
|
+
/** @type {Array<number>} */
|
|
52768
52877
|
|
|
52769
52878
|
var positions = [];
|
|
52770
|
-
/** @type {Array
|
|
52879
|
+
/** @type {Array<string>} */
|
|
52771
52880
|
|
|
52772
52881
|
var results = [];
|
|
52773
52882
|
var whole = value + after;
|
|
@@ -52793,458 +52902,9 @@ function escapeBackslashes(value, after) {
|
|
|
52793
52902
|
results.push(value.slice(start));
|
|
52794
52903
|
return results.join('');
|
|
52795
52904
|
}
|
|
52796
|
-
;// CONCATENATED MODULE: ./node_modules/mdast-util-gfm-footnote/
|
|
52797
|
-
/**
|
|
52798
|
-
* @typedef {import('unist').Node} Node
|
|
52799
|
-
* @typedef {import('unist').Parent} Parent
|
|
52800
|
-
*
|
|
52801
|
-
* @typedef {string} Type
|
|
52802
|
-
* @typedef {Object<string, unknown>} Props
|
|
52803
|
-
*
|
|
52804
|
-
* @typedef {null|undefined|Type|Props|TestFunctionAnything|Array.<Type|Props|TestFunctionAnything>} Test
|
|
52805
|
-
*/
|
|
52806
|
-
|
|
52807
|
-
/**
|
|
52808
|
-
* Check if a node passes a test
|
|
52809
|
-
*
|
|
52810
|
-
* @callback TestFunctionAnything
|
|
52811
|
-
* @param {Node} node
|
|
52812
|
-
* @param {number|null|undefined} [index]
|
|
52813
|
-
* @param {Parent|null|undefined} [parent]
|
|
52814
|
-
* @returns {boolean|void}
|
|
52815
|
-
*/
|
|
52816
|
-
|
|
52817
|
-
/**
|
|
52818
|
-
* Check if a node passes a certain node test
|
|
52819
|
-
*
|
|
52820
|
-
* @template {Node} X
|
|
52821
|
-
* @callback TestFunctionPredicate
|
|
52822
|
-
* @param {Node} node
|
|
52823
|
-
* @param {number|null|undefined} [index]
|
|
52824
|
-
* @param {Parent|null|undefined} [parent]
|
|
52825
|
-
* @returns {node is X}
|
|
52826
|
-
*/
|
|
52827
|
-
|
|
52828
|
-
/**
|
|
52829
|
-
* @callback AssertAnything
|
|
52830
|
-
* @param {unknown} [node]
|
|
52831
|
-
* @param {number|null|undefined} [index]
|
|
52832
|
-
* @param {Parent|null|undefined} [parent]
|
|
52833
|
-
* @returns {boolean}
|
|
52834
|
-
*/
|
|
52835
|
-
|
|
52836
|
-
/**
|
|
52837
|
-
* Check if a node passes a certain node test
|
|
52838
|
-
*
|
|
52839
|
-
* @template {Node} Y
|
|
52840
|
-
* @callback AssertPredicate
|
|
52841
|
-
* @param {unknown} [node]
|
|
52842
|
-
* @param {number|null|undefined} [index]
|
|
52843
|
-
* @param {Parent|null|undefined} [parent]
|
|
52844
|
-
* @returns {node is Y}
|
|
52845
|
-
*/
|
|
52846
|
-
var mdast_util_gfm_footnote_node_modules_unist_util_is_is =
|
|
52847
|
-
/**
|
|
52848
|
-
* Check if a node passes a test.
|
|
52849
|
-
* When a `parent` node is known the `index` of node should also be given.
|
|
52850
|
-
*
|
|
52851
|
-
* @type {(
|
|
52852
|
-
* (<T extends Node>(node: unknown, test: T['type']|Partial<T>|TestFunctionPredicate<T>|Array.<T['type']|Partial<T>|TestFunctionPredicate<T>>, index?: number|null|undefined, parent?: Parent|null|undefined, context?: unknown) => node is T) &
|
|
52853
|
-
* ((node?: unknown, test?: Test, index?: number|null|undefined, parent?: Parent|null|undefined, context?: unknown) => boolean)
|
|
52854
|
-
* )}
|
|
52855
|
-
*/
|
|
52856
|
-
|
|
52857
|
-
/**
|
|
52858
|
-
* Check if a node passes a test.
|
|
52859
|
-
* When a `parent` node is known the `index` of node should also be given.
|
|
52860
|
-
*
|
|
52861
|
-
* @param {unknown} [node] Node to check
|
|
52862
|
-
* @param {Test} [test]
|
|
52863
|
-
* When nullish, checks if `node` is a `Node`.
|
|
52864
|
-
* When `string`, works like passing `function (node) {return node.type === test}`.
|
|
52865
|
-
* When `function` checks if function passed the node is true.
|
|
52866
|
-
* When `object`, checks that all keys in test are in node, and that they have (strictly) equal values.
|
|
52867
|
-
* When `array`, checks any one of the subtests pass.
|
|
52868
|
-
* @param {number|null|undefined} [index] Position of `node` in `parent`
|
|
52869
|
-
* @param {Parent|null|undefined} [parent] Parent of `node`
|
|
52870
|
-
* @param {unknown} [context] Context object to invoke `test` with
|
|
52871
|
-
* @returns {boolean} Whether test passed and `node` is a `Node` (object with `type` set to non-empty `string`).
|
|
52872
|
-
*/
|
|
52873
|
-
// eslint-disable-next-line max-params
|
|
52874
|
-
function is(node, test, index, parent, context) {
|
|
52875
|
-
var check = mdast_util_gfm_footnote_node_modules_unist_util_is_convert(test);
|
|
52876
|
-
|
|
52877
|
-
if (index !== undefined && index !== null && (typeof index !== 'number' || index < 0 || index === Number.POSITIVE_INFINITY)) {
|
|
52878
|
-
throw new Error('Expected positive finite index');
|
|
52879
|
-
}
|
|
52880
|
-
|
|
52881
|
-
if (parent !== undefined && parent !== null && (!is(parent) || !parent.children)) {
|
|
52882
|
-
throw new Error('Expected parent node');
|
|
52883
|
-
}
|
|
52884
|
-
|
|
52885
|
-
if ((parent === undefined || parent === null) !== (index === undefined || index === null)) {
|
|
52886
|
-
throw new Error('Expected both parent and index');
|
|
52887
|
-
} // @ts-expect-error Looks like a node.
|
|
52888
|
-
|
|
52889
|
-
|
|
52890
|
-
return node && node.type && typeof node.type === 'string' ? Boolean(check.call(context, node, index, parent)) : false;
|
|
52891
|
-
};
|
|
52892
|
-
var mdast_util_gfm_footnote_node_modules_unist_util_is_convert =
|
|
52893
|
-
/**
|
|
52894
|
-
* @type {(
|
|
52895
|
-
* (<T extends Node>(test: T['type']|Partial<T>|TestFunctionPredicate<T>) => AssertPredicate<T>) &
|
|
52896
|
-
* ((test?: Test) => AssertAnything)
|
|
52897
|
-
* )}
|
|
52898
|
-
*/
|
|
52899
|
-
|
|
52900
|
-
/**
|
|
52901
|
-
* Generate an assertion from a check.
|
|
52902
|
-
* @param {Test} [test]
|
|
52903
|
-
* When nullish, checks if `node` is a `Node`.
|
|
52904
|
-
* When `string`, works like passing `function (node) {return node.type === test}`.
|
|
52905
|
-
* When `function` checks if function passed the node is true.
|
|
52906
|
-
* When `object`, checks that all keys in test are in node, and that they have (strictly) equal values.
|
|
52907
|
-
* When `array`, checks any one of the subtests pass.
|
|
52908
|
-
* @returns {AssertAnything}
|
|
52909
|
-
*/
|
|
52910
|
-
function convert(test) {
|
|
52911
|
-
if (test === undefined || test === null) {
|
|
52912
|
-
return mdast_util_gfm_footnote_node_modules_unist_util_is_ok;
|
|
52913
|
-
}
|
|
52914
|
-
|
|
52915
|
-
if (typeof test === 'string') {
|
|
52916
|
-
return mdast_util_gfm_footnote_node_modules_unist_util_is_typeFactory(test);
|
|
52917
|
-
}
|
|
52918
|
-
|
|
52919
|
-
if (typeof test === 'object') {
|
|
52920
|
-
return Array.isArray(test) ? mdast_util_gfm_footnote_node_modules_unist_util_is_anyFactory(test) : mdast_util_gfm_footnote_node_modules_unist_util_is_propsFactory(test);
|
|
52921
|
-
}
|
|
52922
|
-
|
|
52923
|
-
if (typeof test === 'function') {
|
|
52924
|
-
return mdast_util_gfm_footnote_node_modules_unist_util_is_castFactory(test);
|
|
52925
|
-
}
|
|
52926
|
-
|
|
52927
|
-
throw new Error('Expected function, string, or object as test');
|
|
52928
|
-
};
|
|
52929
|
-
/**
|
|
52930
|
-
* @param {Array.<Type|Props|TestFunctionAnything>} tests
|
|
52931
|
-
* @returns {AssertAnything}
|
|
52932
|
-
*/
|
|
52933
|
-
|
|
52934
|
-
function mdast_util_gfm_footnote_node_modules_unist_util_is_anyFactory(tests) {
|
|
52935
|
-
/** @type {Array.<AssertAnything>} */
|
|
52936
|
-
var checks = [];
|
|
52937
|
-
var index = -1;
|
|
52938
|
-
|
|
52939
|
-
while (++index < tests.length) {
|
|
52940
|
-
checks[index] = mdast_util_gfm_footnote_node_modules_unist_util_is_convert(tests[index]);
|
|
52941
|
-
}
|
|
52942
|
-
|
|
52943
|
-
return mdast_util_gfm_footnote_node_modules_unist_util_is_castFactory(any);
|
|
52944
|
-
/**
|
|
52945
|
-
* @this {unknown}
|
|
52946
|
-
* @param {unknown[]} parameters
|
|
52947
|
-
* @returns {boolean}
|
|
52948
|
-
*/
|
|
52949
|
-
|
|
52950
|
-
function any() {
|
|
52951
|
-
var index = -1;
|
|
52952
|
-
|
|
52953
|
-
for (var _len = arguments.length, parameters = new Array(_len), _key = 0; _key < _len; _key++) {
|
|
52954
|
-
parameters[_key] = arguments[_key];
|
|
52955
|
-
}
|
|
52956
|
-
|
|
52957
|
-
while (++index < checks.length) {
|
|
52958
|
-
var _checks$index;
|
|
52959
|
-
|
|
52960
|
-
if ((_checks$index = checks[index]).call.apply(_checks$index, [this].concat(parameters))) return true;
|
|
52961
|
-
}
|
|
52962
|
-
|
|
52963
|
-
return false;
|
|
52964
|
-
}
|
|
52965
|
-
}
|
|
52966
|
-
/**
|
|
52967
|
-
* Utility to assert each property in `test` is represented in `node`, and each
|
|
52968
|
-
* values are strictly equal.
|
|
52969
|
-
*
|
|
52970
|
-
* @param {Props} check
|
|
52971
|
-
* @returns {AssertAnything}
|
|
52972
|
-
*/
|
|
52973
|
-
|
|
52974
|
-
|
|
52975
|
-
function mdast_util_gfm_footnote_node_modules_unist_util_is_propsFactory(check) {
|
|
52976
|
-
return mdast_util_gfm_footnote_node_modules_unist_util_is_castFactory(all);
|
|
52977
|
-
/**
|
|
52978
|
-
* @param {Node} node
|
|
52979
|
-
* @returns {boolean}
|
|
52980
|
-
*/
|
|
52981
|
-
|
|
52982
|
-
function all(node) {
|
|
52983
|
-
/** @type {string} */
|
|
52984
|
-
var key;
|
|
52985
|
-
|
|
52986
|
-
for (key in check) {
|
|
52987
|
-
// @ts-expect-error: hush, it sure works as an index.
|
|
52988
|
-
if (node[key] !== check[key]) return false;
|
|
52989
|
-
}
|
|
52990
|
-
|
|
52991
|
-
return true;
|
|
52992
|
-
}
|
|
52993
|
-
}
|
|
52994
|
-
/**
|
|
52995
|
-
* Utility to convert a string into a function which checks a given node’s type
|
|
52996
|
-
* for said string.
|
|
52997
|
-
*
|
|
52998
|
-
* @param {Type} check
|
|
52999
|
-
* @returns {AssertAnything}
|
|
53000
|
-
*/
|
|
53001
|
-
|
|
53002
|
-
|
|
53003
|
-
function mdast_util_gfm_footnote_node_modules_unist_util_is_typeFactory(check) {
|
|
53004
|
-
return mdast_util_gfm_footnote_node_modules_unist_util_is_castFactory(type);
|
|
53005
|
-
/**
|
|
53006
|
-
* @param {Node} node
|
|
53007
|
-
*/
|
|
53008
|
-
|
|
53009
|
-
function type(node) {
|
|
53010
|
-
return node && node.type === check;
|
|
53011
|
-
}
|
|
53012
|
-
}
|
|
53013
|
-
/**
|
|
53014
|
-
* Utility to convert a string into a function which checks a given node’s type
|
|
53015
|
-
* for said string.
|
|
53016
|
-
* @param {TestFunctionAnything} check
|
|
53017
|
-
* @returns {AssertAnything}
|
|
53018
|
-
*/
|
|
53019
|
-
|
|
53020
|
-
|
|
53021
|
-
function mdast_util_gfm_footnote_node_modules_unist_util_is_castFactory(check) {
|
|
53022
|
-
return assertion;
|
|
53023
|
-
/**
|
|
53024
|
-
* @this {unknown}
|
|
53025
|
-
* @param {Array.<unknown>} parameters
|
|
53026
|
-
* @returns {boolean}
|
|
53027
|
-
*/
|
|
53028
|
-
|
|
53029
|
-
function assertion() {
|
|
53030
|
-
for (var _len2 = arguments.length, parameters = new Array(_len2), _key2 = 0; _key2 < _len2; _key2++) {
|
|
53031
|
-
parameters[_key2] = arguments[_key2];
|
|
53032
|
-
}
|
|
53033
|
-
|
|
53034
|
-
// @ts-expect-error: spreading is fine.
|
|
53035
|
-
return Boolean(check.call.apply(check, [this].concat(parameters)));
|
|
53036
|
-
}
|
|
53037
|
-
} // Utility to return true.
|
|
53038
|
-
|
|
53039
|
-
|
|
53040
|
-
function mdast_util_gfm_footnote_node_modules_unist_util_is_ok() {
|
|
53041
|
-
return true;
|
|
53042
|
-
}
|
|
53043
|
-
;// CONCATENATED MODULE: ./node_modules/mdast-util-gfm-footnote/node_modules/unist-util-visit-parents/color.browser.js
|
|
53044
|
-
/**
|
|
53045
|
-
* @param {string} d
|
|
53046
|
-
* @returns {string}
|
|
53047
|
-
*/
|
|
53048
|
-
function mdast_util_gfm_footnote_node_modules_unist_util_visit_parents_color_browser_color(d) {
|
|
53049
|
-
return d;
|
|
53050
|
-
}
|
|
53051
|
-
;// CONCATENATED MODULE: ./node_modules/mdast-util-gfm-footnote/node_modules/unist-util-visit-parents/index.js
|
|
53052
|
-
/**
|
|
53053
|
-
* @typedef {import('unist').Node} Node
|
|
53054
|
-
* @typedef {import('unist').Parent} Parent
|
|
53055
|
-
* @typedef {import('unist-util-is').Test} Test
|
|
53056
|
-
* @typedef {import('./complex-types').Action} Action
|
|
53057
|
-
* @typedef {import('./complex-types').Index} Index
|
|
53058
|
-
* @typedef {import('./complex-types').ActionTuple} ActionTuple
|
|
53059
|
-
* @typedef {import('./complex-types').VisitorResult} VisitorResult
|
|
53060
|
-
* @typedef {import('./complex-types').Visitor} Visitor
|
|
53061
|
-
*/
|
|
53062
|
-
|
|
53063
|
-
|
|
53064
|
-
/**
|
|
53065
|
-
* Continue traversing as normal
|
|
53066
|
-
*/
|
|
53067
|
-
|
|
53068
|
-
var mdast_util_gfm_footnote_node_modules_unist_util_visit_parents_CONTINUE = true;
|
|
53069
|
-
/**
|
|
53070
|
-
* Do not traverse this node’s children
|
|
53071
|
-
*/
|
|
53072
|
-
|
|
53073
|
-
var mdast_util_gfm_footnote_node_modules_unist_util_visit_parents_SKIP = 'skip';
|
|
53074
|
-
/**
|
|
53075
|
-
* Stop traversing immediately
|
|
53076
|
-
*/
|
|
53077
|
-
|
|
53078
|
-
var mdast_util_gfm_footnote_node_modules_unist_util_visit_parents_EXIT = false;
|
|
53079
|
-
/**
|
|
53080
|
-
* Visit children of tree which pass a test
|
|
53081
|
-
*
|
|
53082
|
-
* @param tree Abstract syntax tree to walk
|
|
53083
|
-
* @param test Test node, optional
|
|
53084
|
-
* @param visitor Function to run for each node
|
|
53085
|
-
* @param reverse Visit the tree in reverse order, defaults to false
|
|
53086
|
-
*/
|
|
53087
|
-
|
|
53088
|
-
var mdast_util_gfm_footnote_node_modules_unist_util_visit_parents_visitParents =
|
|
53089
|
-
/**
|
|
53090
|
-
* @type {(
|
|
53091
|
-
* (<Tree extends Node, Check extends Test>(tree: Tree, test: Check, visitor: import('./complex-types').BuildVisitor<Tree, Check>, reverse?: boolean) => void) &
|
|
53092
|
-
* (<Tree extends Node>(tree: Tree, visitor: import('./complex-types').BuildVisitor<Tree>, reverse?: boolean) => void)
|
|
53093
|
-
* )}
|
|
53094
|
-
*/
|
|
53095
|
-
|
|
53096
|
-
/**
|
|
53097
|
-
* @param {Node} tree
|
|
53098
|
-
* @param {Test} test
|
|
53099
|
-
* @param {import('./complex-types').Visitor<Node>} visitor
|
|
53100
|
-
* @param {boolean} [reverse]
|
|
53101
|
-
*/
|
|
53102
|
-
function visitParents(tree, test, visitor, reverse) {
|
|
53103
|
-
if (typeof test === 'function' && typeof visitor !== 'function') {
|
|
53104
|
-
reverse = visitor; // @ts-expect-error no visitor given, so `visitor` is test.
|
|
53105
|
-
|
|
53106
|
-
visitor = test;
|
|
53107
|
-
test = null;
|
|
53108
|
-
}
|
|
53109
|
-
|
|
53110
|
-
var is = mdast_util_gfm_footnote_node_modules_unist_util_is_convert(test);
|
|
53111
|
-
var step = reverse ? -1 : 1;
|
|
53112
|
-
factory(tree, null, [])();
|
|
53113
|
-
/**
|
|
53114
|
-
* @param {Node} node
|
|
53115
|
-
* @param {number?} index
|
|
53116
|
-
* @param {Array.<Parent>} parents
|
|
53117
|
-
*/
|
|
53118
|
-
|
|
53119
|
-
function factory(node, index, parents) {
|
|
53120
|
-
/** @type {Object.<string, unknown>} */
|
|
53121
|
-
// @ts-expect-error: hush
|
|
53122
|
-
var value = typeof node === 'object' && node !== null ? node : {};
|
|
53123
|
-
/** @type {string|undefined} */
|
|
53124
|
-
|
|
53125
|
-
var name;
|
|
53126
|
-
|
|
53127
|
-
if (typeof value.type === 'string') {
|
|
53128
|
-
name = typeof value.tagName === 'string' ? value.tagName : typeof value.name === 'string' ? value.name : undefined;
|
|
53129
|
-
Object.defineProperty(visit, 'name', {
|
|
53130
|
-
value: 'node (' + mdast_util_gfm_footnote_node_modules_unist_util_visit_parents_color_browser_color(value.type + (name ? '<' + name + '>' : '')) + ')'
|
|
53131
|
-
});
|
|
53132
|
-
}
|
|
53133
|
-
|
|
53134
|
-
return visit;
|
|
53135
|
-
|
|
53136
|
-
function visit() {
|
|
53137
|
-
/** @type {ActionTuple} */
|
|
53138
|
-
var result = [];
|
|
53139
|
-
/** @type {ActionTuple} */
|
|
53140
|
-
|
|
53141
|
-
var subresult;
|
|
53142
|
-
/** @type {number} */
|
|
53143
|
-
|
|
53144
|
-
var offset;
|
|
53145
|
-
/** @type {Array.<Parent>} */
|
|
53146
|
-
|
|
53147
|
-
var grandparents;
|
|
53148
|
-
|
|
53149
|
-
if (!test || is(node, index, parents[parents.length - 1] || null)) {
|
|
53150
|
-
result = mdast_util_gfm_footnote_node_modules_unist_util_visit_parents_toResult(visitor(node, parents));
|
|
53151
|
-
|
|
53152
|
-
if (result[0] === mdast_util_gfm_footnote_node_modules_unist_util_visit_parents_EXIT) {
|
|
53153
|
-
return result;
|
|
53154
|
-
}
|
|
53155
|
-
} // @ts-expect-error looks like a parent.
|
|
53156
|
-
|
|
53157
|
-
|
|
53158
|
-
if (node.children && result[0] !== mdast_util_gfm_footnote_node_modules_unist_util_visit_parents_SKIP) {
|
|
53159
|
-
// @ts-expect-error looks like a parent.
|
|
53160
|
-
offset = (reverse ? node.children.length : -1) + step; // @ts-expect-error looks like a parent.
|
|
53161
|
-
|
|
53162
|
-
grandparents = parents.concat(node); // @ts-expect-error looks like a parent.
|
|
53163
|
-
|
|
53164
|
-
while (offset > -1 && offset < node.children.length) {
|
|
53165
|
-
// @ts-expect-error looks like a parent.
|
|
53166
|
-
subresult = factory(node.children[offset], offset, grandparents)();
|
|
53167
|
-
|
|
53168
|
-
if (subresult[0] === mdast_util_gfm_footnote_node_modules_unist_util_visit_parents_EXIT) {
|
|
53169
|
-
return subresult;
|
|
53170
|
-
}
|
|
53171
|
-
|
|
53172
|
-
offset = typeof subresult[1] === 'number' ? subresult[1] : offset + step;
|
|
53173
|
-
}
|
|
53174
|
-
}
|
|
53175
|
-
|
|
53176
|
-
return result;
|
|
53177
|
-
}
|
|
53178
|
-
}
|
|
53179
|
-
};
|
|
53180
|
-
/**
|
|
53181
|
-
* @param {VisitorResult} value
|
|
53182
|
-
* @returns {ActionTuple}
|
|
53183
|
-
*/
|
|
53184
|
-
|
|
53185
|
-
function mdast_util_gfm_footnote_node_modules_unist_util_visit_parents_toResult(value) {
|
|
53186
|
-
if (Array.isArray(value)) {
|
|
53187
|
-
return value;
|
|
53188
|
-
}
|
|
53189
|
-
|
|
53190
|
-
if (typeof value === 'number') {
|
|
53191
|
-
return [mdast_util_gfm_footnote_node_modules_unist_util_visit_parents_CONTINUE, value];
|
|
53192
|
-
}
|
|
53193
|
-
|
|
53194
|
-
return [value];
|
|
53195
|
-
}
|
|
53196
|
-
;// CONCATENATED MODULE: ./node_modules/mdast-util-gfm-footnote/node_modules/unist-util-visit/index.js
|
|
53197
|
-
/**
|
|
53198
|
-
* @typedef {import('unist').Node} Node
|
|
53199
|
-
* @typedef {import('unist').Parent} Parent
|
|
53200
|
-
* @typedef {import('unist-util-is').Test} Test
|
|
53201
|
-
* @typedef {import('unist-util-visit-parents').VisitorResult} VisitorResult
|
|
53202
|
-
* @typedef {import('./complex-types').Visitor} Visitor
|
|
53203
|
-
*/
|
|
53204
|
-
|
|
53205
|
-
|
|
53206
|
-
/**
|
|
53207
|
-
* Visit children of tree which pass a test
|
|
53208
|
-
*
|
|
53209
|
-
* @param tree Abstract syntax tree to walk
|
|
53210
|
-
* @param test Test, optional
|
|
53211
|
-
* @param visitor Function to run for each node
|
|
53212
|
-
* @param reverse Fisit the tree in reverse, defaults to false
|
|
53213
|
-
*/
|
|
53214
|
-
|
|
53215
|
-
var mdast_util_gfm_footnote_node_modules_unist_util_visit_visit =
|
|
53216
|
-
/**
|
|
53217
|
-
* @type {(
|
|
53218
|
-
* (<Tree extends Node, Check extends Test>(tree: Tree, test: Check, visitor: import('./complex-types').BuildVisitor<Tree, Check>, reverse?: boolean) => void) &
|
|
53219
|
-
* (<Tree extends Node>(tree: Tree, visitor: import('./complex-types').BuildVisitor<Tree>, reverse?: boolean) => void)
|
|
53220
|
-
* )}
|
|
53221
|
-
*/
|
|
53222
|
-
|
|
53223
|
-
/**
|
|
53224
|
-
* @param {Node} tree
|
|
53225
|
-
* @param {Test} test
|
|
53226
|
-
* @param {import('./complex-types').Visitor} visitor
|
|
53227
|
-
* @param {boolean} [reverse]
|
|
53228
|
-
*/
|
|
53229
|
-
function visit(tree, test, visitor, reverse) {
|
|
53230
|
-
if (typeof test === 'function' && typeof visitor !== 'function') {
|
|
53231
|
-
reverse = visitor;
|
|
53232
|
-
visitor = test;
|
|
53233
|
-
test = null;
|
|
53234
|
-
}
|
|
52905
|
+
;// CONCATENATED MODULE: ./node_modules/mdast-util-gfm-footnote/index.js
|
|
53235
52906
|
|
|
53236
|
-
mdast_util_gfm_footnote_node_modules_unist_util_visit_parents_visitParents(tree, test, overload, reverse);
|
|
53237
|
-
/**
|
|
53238
|
-
* @param {Node} node
|
|
53239
|
-
* @param {Array.<Parent>} parents
|
|
53240
|
-
*/
|
|
53241
52907
|
|
|
53242
|
-
function overload(node, parents) {
|
|
53243
|
-
var parent = parents[parents.length - 1];
|
|
53244
|
-
return visitor(node, parent ? parent.children.indexOf(node) : null, parent);
|
|
53245
|
-
}
|
|
53246
|
-
};
|
|
53247
|
-
;// CONCATENATED MODULE: ./node_modules/mdast-util-gfm-footnote/index.js
|
|
53248
52908
|
/**
|
|
53249
52909
|
* @typedef {import('mdast').FootnoteReference} FootnoteReference
|
|
53250
52910
|
* @typedef {import('mdast').FootnoteDefinition} FootnoteDefinition
|
|
@@ -53260,8 +52920,6 @@ function visit(tree, test, visitor, reverse) {
|
|
|
53260
52920
|
|
|
53261
52921
|
|
|
53262
52922
|
|
|
53263
|
-
var warningColonInFootnote = false;
|
|
53264
|
-
var warningListInFootnote = false;
|
|
53265
52923
|
/**
|
|
53266
52924
|
* @returns {FromMarkdownExtension}
|
|
53267
52925
|
*/
|
|
@@ -53370,16 +53028,19 @@ function gfmFootnoteToMarkdown() {
|
|
|
53370
53028
|
* @param {FootnoteReference} node
|
|
53371
53029
|
*/
|
|
53372
53030
|
|
|
53373
|
-
function footnoteReference(node, _, context) {
|
|
53031
|
+
function footnoteReference(node, _, context, safeOptions) {
|
|
53032
|
+
var tracker = track(safeOptions);
|
|
53033
|
+
var value = tracker.move('[^');
|
|
53374
53034
|
var exit = context.enter('footnoteReference');
|
|
53375
53035
|
var subexit = context.enter('reference');
|
|
53376
|
-
|
|
53377
|
-
before:
|
|
53036
|
+
value += tracker.move(safe(context, association(node), _objectSpread2(_objectSpread2({}, tracker.current()), {}, {
|
|
53037
|
+
before: value,
|
|
53378
53038
|
after: ']'
|
|
53379
|
-
});
|
|
53039
|
+
})));
|
|
53380
53040
|
subexit();
|
|
53381
53041
|
exit();
|
|
53382
|
-
|
|
53042
|
+
value += tracker.move(']');
|
|
53043
|
+
return value;
|
|
53383
53044
|
}
|
|
53384
53045
|
/** @type {ToMarkdownHandle} */
|
|
53385
53046
|
|
|
@@ -53393,31 +53054,20 @@ function gfmFootnoteToMarkdown() {
|
|
|
53393
53054
|
*/
|
|
53394
53055
|
|
|
53395
53056
|
|
|
53396
|
-
function footnoteDefinition(node, _, context) {
|
|
53057
|
+
function footnoteDefinition(node, _, context, safeOptions) {
|
|
53058
|
+
var tracker = track(safeOptions);
|
|
53059
|
+
var value = tracker.move('[^');
|
|
53397
53060
|
var exit = context.enter('footnoteDefinition');
|
|
53398
53061
|
var subexit = context.enter('label');
|
|
53399
|
-
|
|
53400
|
-
before:
|
|
53062
|
+
value += tracker.move(safe(context, association(node), _objectSpread2(_objectSpread2({}, tracker.current()), {}, {
|
|
53063
|
+
before: value,
|
|
53401
53064
|
after: ']'
|
|
53402
|
-
});
|
|
53403
|
-
var label = '[^' + id + ']:';
|
|
53065
|
+
})));
|
|
53404
53066
|
subexit();
|
|
53405
|
-
|
|
53067
|
+
value += tracker.move(']:' + (node.children && node.children.length > 0 ? ' ' : ''));
|
|
53068
|
+
tracker.shift(4);
|
|
53069
|
+
value += tracker.move(indentLines(containerFlow(node, context, tracker.current()), map));
|
|
53406
53070
|
exit();
|
|
53407
|
-
|
|
53408
|
-
if (!warningColonInFootnote && id.includes(':')) {
|
|
53409
|
-
console.warn('[mdast-util-gfm-footnote] Warning: Found a colon in footnote identifier `' + id + '`. GitHub currently crahes on colons in footnotes (see <https://github.com/github/cmark-gfm/issues/241> for more info)');
|
|
53410
|
-
warningColonInFootnote = true;
|
|
53411
|
-
}
|
|
53412
|
-
|
|
53413
|
-
if (!warningListInFootnote) {
|
|
53414
|
-
mdast_util_gfm_footnote_node_modules_unist_util_visit_visit(node, 'list', function () {
|
|
53415
|
-
console.warn('[mdast-util-gfm-footnote] Warning: Found a list in a footnote definition. GitHub currently crahes on lists in footnotes (see <https://github.com/github/cmark-gfm/issues/241> for more info)');
|
|
53416
|
-
warningListInFootnote = true;
|
|
53417
|
-
return mdast_util_gfm_footnote_node_modules_unist_util_visit_parents_EXIT;
|
|
53418
|
-
});
|
|
53419
|
-
}
|
|
53420
|
-
|
|
53421
53071
|
return value;
|
|
53422
53072
|
/** @type {Map} */
|
|
53423
53073
|
|
|
@@ -53426,11 +53076,13 @@ function gfmFootnoteToMarkdown() {
|
|
|
53426
53076
|
return (blank ? '' : ' ') + line;
|
|
53427
53077
|
}
|
|
53428
53078
|
|
|
53429
|
-
return
|
|
53079
|
+
return line;
|
|
53430
53080
|
}
|
|
53431
53081
|
}
|
|
53432
53082
|
}
|
|
53433
53083
|
;// CONCATENATED MODULE: ./node_modules/mdast-util-to-markdown/lib/util/container-phrasing.js
|
|
53084
|
+
|
|
53085
|
+
|
|
53434
53086
|
/**
|
|
53435
53087
|
* @typedef {import('../types.js').Node} Node
|
|
53436
53088
|
* @typedef {import('../types.js').Parent} Parent
|
|
@@ -53444,15 +53096,17 @@ function gfmFootnoteToMarkdown() {
|
|
|
53444
53096
|
* @param {SafeOptions} safeOptions
|
|
53445
53097
|
* @returns {string}
|
|
53446
53098
|
*/
|
|
53099
|
+
|
|
53447
53100
|
function containerPhrasing(parent, context, safeOptions) {
|
|
53448
53101
|
var indexStack = context.indexStack;
|
|
53449
53102
|
var children = parent.children || [];
|
|
53450
|
-
/** @type {Array
|
|
53103
|
+
/** @type {Array<string>} */
|
|
53451
53104
|
|
|
53452
53105
|
var results = [];
|
|
53453
53106
|
var index = -1;
|
|
53454
53107
|
var before = safeOptions.before;
|
|
53455
53108
|
indexStack.push(-1);
|
|
53109
|
+
var tracker = track(safeOptions);
|
|
53456
53110
|
|
|
53457
53111
|
while (++index < children.length) {
|
|
53458
53112
|
var child = children[index];
|
|
@@ -53465,10 +53119,10 @@ function containerPhrasing(parent, context, safeOptions) {
|
|
|
53465
53119
|
// @ts-expect-error: hush, it’s actually a `zwitch`.
|
|
53466
53120
|
var handle = context.handle.handlers[children[index + 1].type];
|
|
53467
53121
|
if (handle && handle.peek) handle = handle.peek;
|
|
53468
|
-
after = handle ? handle(children[index + 1], parent, context, {
|
|
53122
|
+
after = handle ? handle(children[index + 1], parent, context, _objectSpread2({
|
|
53469
53123
|
before: '',
|
|
53470
53124
|
after: ''
|
|
53471
|
-
}).charAt(0) : '';
|
|
53125
|
+
}, tracker.current())).charAt(0) : '';
|
|
53472
53126
|
} else {
|
|
53473
53127
|
after = safeOptions.after;
|
|
53474
53128
|
} // In some cases, html (text) can be found in phrasing right after an eol.
|
|
@@ -53481,13 +53135,16 @@ function containerPhrasing(parent, context, safeOptions) {
|
|
|
53481
53135
|
|
|
53482
53136
|
if (results.length > 0 && (before === '\r' || before === '\n') && child.type === 'html') {
|
|
53483
53137
|
results[results.length - 1] = results[results.length - 1].replace(/(\r?\n|\r)$/, ' ');
|
|
53484
|
-
before = ' ';
|
|
53138
|
+
before = ' '; // To do: does this work to reset tracker?
|
|
53139
|
+
|
|
53140
|
+
tracker = track(safeOptions);
|
|
53141
|
+
tracker.move(results.join(''));
|
|
53485
53142
|
}
|
|
53486
53143
|
|
|
53487
|
-
results.push(context.handle(child, parent, context, {
|
|
53144
|
+
results.push(tracker.move(context.handle(child, parent, context, _objectSpread2(_objectSpread2({}, tracker.current()), {}, {
|
|
53488
53145
|
before: before,
|
|
53489
53146
|
after: after
|
|
53490
|
-
}));
|
|
53147
|
+
}))));
|
|
53491
53148
|
before = results[results.length - 1].slice(-1);
|
|
53492
53149
|
}
|
|
53493
53150
|
|
|
@@ -53495,6 +53152,8 @@ function containerPhrasing(parent, context, safeOptions) {
|
|
|
53495
53152
|
return results.join('');
|
|
53496
53153
|
}
|
|
53497
53154
|
;// CONCATENATED MODULE: ./node_modules/mdast-util-gfm-strikethrough/index.js
|
|
53155
|
+
|
|
53156
|
+
|
|
53498
53157
|
/**
|
|
53499
53158
|
* @typedef {import('mdast').Delete} Delete
|
|
53500
53159
|
* @typedef {import('mdast-util-from-markdown').Extension} FromMarkdownExtension
|
|
@@ -53503,6 +53162,7 @@ function containerPhrasing(parent, context, safeOptions) {
|
|
|
53503
53162
|
* @typedef {import('mdast-util-to-markdown').Handle} ToMarkdownHandle
|
|
53504
53163
|
*/
|
|
53505
53164
|
|
|
53165
|
+
|
|
53506
53166
|
/** @type {FromMarkdownExtension} */
|
|
53507
53167
|
|
|
53508
53168
|
var gfmStrikethroughFromMarkdown = {
|
|
@@ -53546,14 +53206,17 @@ function exitStrikethrough(token) {
|
|
|
53546
53206
|
*/
|
|
53547
53207
|
|
|
53548
53208
|
|
|
53549
|
-
function handleDelete(node, _, context) {
|
|
53209
|
+
function handleDelete(node, _, context, safeOptions) {
|
|
53210
|
+
var tracker = track(safeOptions);
|
|
53550
53211
|
var exit = context.enter('emphasis');
|
|
53551
|
-
var value =
|
|
53552
|
-
|
|
53212
|
+
var value = tracker.move('~~');
|
|
53213
|
+
value += containerPhrasing(node, context, _objectSpread2(_objectSpread2({}, tracker.current()), {}, {
|
|
53214
|
+
before: value,
|
|
53553
53215
|
after: '~'
|
|
53554
|
-
});
|
|
53216
|
+
}));
|
|
53217
|
+
value += tracker.move('~~');
|
|
53555
53218
|
exit();
|
|
53556
|
-
return
|
|
53219
|
+
return value;
|
|
53557
53220
|
}
|
|
53558
53221
|
/** @type {ToMarkdownHandle} */
|
|
53559
53222
|
|
|
@@ -54027,6 +53690,8 @@ function toAlignment(value) {
|
|
|
54027
53690
|
: 0;
|
|
54028
53691
|
}
|
|
54029
53692
|
;// CONCATENATED MODULE: ./node_modules/mdast-util-gfm-table/index.js
|
|
53693
|
+
|
|
53694
|
+
|
|
54030
53695
|
/**
|
|
54031
53696
|
* @typedef {import('mdast').AlignType} AlignType
|
|
54032
53697
|
* @typedef {import('mdast').Table} Table
|
|
@@ -54039,6 +53704,7 @@ function toAlignment(value) {
|
|
|
54039
53704
|
* @typedef {import('mdast-util-to-markdown').Options} ToMarkdownExtension
|
|
54040
53705
|
* @typedef {import('mdast-util-to-markdown').Handle} ToMarkdownHandle
|
|
54041
53706
|
* @typedef {import('mdast-util-to-markdown').Context} ToMarkdownContext
|
|
53707
|
+
* @typedef {import('mdast-util-to-markdown').SafeOptions} SafeOptions
|
|
54042
53708
|
*
|
|
54043
53709
|
* @typedef Options
|
|
54044
53710
|
* @property {boolean} [tableCellPadding=true]
|
|
@@ -54197,9 +53863,9 @@ function gfmTableToMarkdown(options) {
|
|
|
54197
53863
|
* @param {Table} node
|
|
54198
53864
|
*/
|
|
54199
53865
|
|
|
54200
|
-
function handleTable(node, _, context) {
|
|
54201
|
-
// @ts-expect-error: fixed in `markdown-table@3.0.1`.
|
|
54202
|
-
|
|
53866
|
+
function handleTable(node, _, context, safeOptions) {
|
|
53867
|
+
return serializeData(handleTableAsData(node, context, safeOptions), // @ts-expect-error: fixed in `markdown-table@3.0.1`.
|
|
53868
|
+
node.align);
|
|
54203
53869
|
}
|
|
54204
53870
|
/**
|
|
54205
53871
|
* This function isn’t really used normally, because we handle rows at the
|
|
@@ -54211,8 +53877,8 @@ function gfmTableToMarkdown(options) {
|
|
|
54211
53877
|
*/
|
|
54212
53878
|
|
|
54213
53879
|
|
|
54214
|
-
function handleTableRow(node, _, context) {
|
|
54215
|
-
var row = handleTableRowAsData(node, context); // `markdown-table` will always add an align row
|
|
53880
|
+
function handleTableRow(node, _, context, safeOptions) {
|
|
53881
|
+
var row = handleTableRowAsData(node, context, safeOptions); // `markdown-table` will always add an align row
|
|
54216
53882
|
|
|
54217
53883
|
var value = serializeData([row]);
|
|
54218
53884
|
return value.slice(0, value.indexOf('\n'));
|
|
@@ -54223,20 +53889,20 @@ function gfmTableToMarkdown(options) {
|
|
|
54223
53889
|
*/
|
|
54224
53890
|
|
|
54225
53891
|
|
|
54226
|
-
function handleTableCell(node, _, context) {
|
|
53892
|
+
function handleTableCell(node, _, context, safeOptions) {
|
|
54227
53893
|
var exit = context.enter('tableCell');
|
|
54228
53894
|
var subexit = context.enter('phrasing');
|
|
54229
|
-
var value = containerPhrasing(node, context, {
|
|
53895
|
+
var value = containerPhrasing(node, context, _objectSpread2(_objectSpread2({}, safeOptions), {}, {
|
|
54230
53896
|
before: around,
|
|
54231
53897
|
after: around
|
|
54232
|
-
});
|
|
53898
|
+
}));
|
|
54233
53899
|
subexit();
|
|
54234
53900
|
exit();
|
|
54235
53901
|
return value;
|
|
54236
53902
|
}
|
|
54237
53903
|
/**
|
|
54238
|
-
* @param {Array
|
|
54239
|
-
* @param {Array
|
|
53904
|
+
* @param {Array<Array<string>>} matrix
|
|
53905
|
+
* @param {Array<string>} [align]
|
|
54240
53906
|
*/
|
|
54241
53907
|
|
|
54242
53908
|
|
|
@@ -54251,19 +53917,20 @@ function gfmTableToMarkdown(options) {
|
|
|
54251
53917
|
/**
|
|
54252
53918
|
* @param {Table} node
|
|
54253
53919
|
* @param {ToMarkdownContext} context
|
|
53920
|
+
* @param {SafeOptions} safeOptions
|
|
54254
53921
|
*/
|
|
54255
53922
|
|
|
54256
53923
|
|
|
54257
|
-
function handleTableAsData(node, context) {
|
|
53924
|
+
function handleTableAsData(node, context, safeOptions) {
|
|
54258
53925
|
var children = node.children;
|
|
54259
53926
|
var index = -1;
|
|
54260
|
-
/** @type {Array
|
|
53927
|
+
/** @type {Array<Array<string>>} */
|
|
54261
53928
|
|
|
54262
53929
|
var result = [];
|
|
54263
53930
|
var subexit = context.enter('table');
|
|
54264
53931
|
|
|
54265
53932
|
while (++index < children.length) {
|
|
54266
|
-
result[index] = handleTableRowAsData(children[index], context);
|
|
53933
|
+
result[index] = handleTableRowAsData(children[index], context, safeOptions);
|
|
54267
53934
|
}
|
|
54268
53935
|
|
|
54269
53936
|
subexit();
|
|
@@ -54272,19 +53939,23 @@ function gfmTableToMarkdown(options) {
|
|
|
54272
53939
|
/**
|
|
54273
53940
|
* @param {TableRow} node
|
|
54274
53941
|
* @param {ToMarkdownContext} context
|
|
53942
|
+
* @param {SafeOptions} safeOptions
|
|
54275
53943
|
*/
|
|
54276
53944
|
|
|
54277
53945
|
|
|
54278
|
-
function handleTableRowAsData(node, context) {
|
|
53946
|
+
function handleTableRowAsData(node, context, safeOptions) {
|
|
54279
53947
|
var children = node.children;
|
|
54280
53948
|
var index = -1;
|
|
54281
|
-
/** @type {Array
|
|
53949
|
+
/** @type {Array<string>} */
|
|
54282
53950
|
|
|
54283
53951
|
var result = [];
|
|
54284
53952
|
var subexit = context.enter('tableRow');
|
|
54285
53953
|
|
|
54286
53954
|
while (++index < children.length) {
|
|
54287
|
-
|
|
53955
|
+
// Note: the positional info as used here is incorrect.
|
|
53956
|
+
// Making it correct would be impossible due to aligning cells?
|
|
53957
|
+
// And it would need copy/pasting `markdown-table` into this project.
|
|
53958
|
+
result[index] = handleTableCell(children[index], node, context, safeOptions);
|
|
54288
53959
|
}
|
|
54289
53960
|
|
|
54290
53961
|
subexit();
|
|
@@ -54361,12 +54032,13 @@ function checkListItemIndent(context) {
|
|
|
54361
54032
|
|
|
54362
54033
|
|
|
54363
54034
|
|
|
54035
|
+
|
|
54364
54036
|
/**
|
|
54365
54037
|
* @type {Handle}
|
|
54366
54038
|
* @param {ListItem} node
|
|
54367
54039
|
*/
|
|
54368
54040
|
|
|
54369
|
-
function list_item_listItem(node, parent, context) {
|
|
54041
|
+
function list_item_listItem(node, parent, context, safeOptions) {
|
|
54370
54042
|
var listItemIndent = checkListItemIndent(context);
|
|
54371
54043
|
var bullet = context.bulletCurrent || checkBullet(context); // Add the marker value for ordered lists.
|
|
54372
54044
|
|
|
@@ -54380,8 +54052,11 @@ function list_item_listItem(node, parent, context) {
|
|
|
54380
54052
|
size = Math.ceil(size / 4) * 4;
|
|
54381
54053
|
}
|
|
54382
54054
|
|
|
54055
|
+
var tracker = track(safeOptions);
|
|
54056
|
+
tracker.move(bullet + ' '.repeat(size - bullet.length));
|
|
54057
|
+
tracker.shift(size);
|
|
54383
54058
|
var exit = context.enter('listItem');
|
|
54384
|
-
var value = indentLines(containerFlow(node, context), map);
|
|
54059
|
+
var value = indentLines(containerFlow(node, context, tracker.current()), map);
|
|
54385
54060
|
exit();
|
|
54386
54061
|
return value;
|
|
54387
54062
|
/** @type {Map} */
|
|
@@ -54395,7 +54070,10 @@ function list_item_listItem(node, parent, context) {
|
|
|
54395
54070
|
}
|
|
54396
54071
|
}
|
|
54397
54072
|
;// CONCATENATED MODULE: ./node_modules/mdast-util-gfm-task-list-item/index.js
|
|
54073
|
+
|
|
54074
|
+
|
|
54398
54075
|
/**
|
|
54076
|
+
* @typedef {Extract<import('mdast').Root|import('mdast').Content, import('unist').Parent>} Parent
|
|
54399
54077
|
* @typedef {import('mdast').ListItem} ListItem
|
|
54400
54078
|
* @typedef {import('mdast').Paragraph} Paragraph
|
|
54401
54079
|
* @typedef {import('mdast').BlockContent} BlockContent
|
|
@@ -54405,6 +54083,7 @@ function list_item_listItem(node, parent, context) {
|
|
|
54405
54083
|
* @typedef {import('mdast-util-to-markdown').Handle} ToMarkdownHandle
|
|
54406
54084
|
*/
|
|
54407
54085
|
|
|
54086
|
+
|
|
54408
54087
|
/** @type {FromMarkdownExtension} */
|
|
54409
54088
|
|
|
54410
54089
|
var gfmTaskListItemFromMarkdown = {
|
|
@@ -54429,21 +54108,22 @@ var gfmTaskListItemToMarkdown = {
|
|
|
54429
54108
|
/** @type {FromMarkdownHandle} */
|
|
54430
54109
|
|
|
54431
54110
|
function exitCheck(token) {
|
|
54432
|
-
|
|
54433
|
-
|
|
54111
|
+
var node =
|
|
54112
|
+
/** @type {ListItem} */
|
|
54113
|
+
this.stack[this.stack.length - 2]; // We’re always in a paragraph, in a list item.
|
|
54114
|
+
|
|
54115
|
+
node.checked = token.type === 'taskListCheckValueChecked';
|
|
54434
54116
|
}
|
|
54435
54117
|
/** @type {FromMarkdownHandle} */
|
|
54436
54118
|
|
|
54437
54119
|
|
|
54438
54120
|
function exitParagraphWithTaskListItem(token) {
|
|
54439
|
-
var parent =
|
|
54121
|
+
var parent =
|
|
54122
|
+
/** @type {Parent} */
|
|
54123
|
+
this.stack[this.stack.length - 2];
|
|
54124
|
+
var node =
|
|
54440
54125
|
/** @type {Paragraph} */
|
|
54441
|
-
|
|
54442
|
-
|
|
54443
|
-
var node = this.stack[this.stack.length - 1];
|
|
54444
|
-
/** @type {BlockContent[]} */
|
|
54445
|
-
// @ts-expect-error: check whether `parent` is a `listItem` later.
|
|
54446
|
-
|
|
54126
|
+
this.stack[this.stack.length - 1];
|
|
54447
54127
|
var siblings = parent.children;
|
|
54448
54128
|
var head = node.children[0];
|
|
54449
54129
|
var index = -1;
|
|
@@ -54467,12 +54147,9 @@ function exitParagraphWithTaskListItem(token) {
|
|
|
54467
54147
|
|
|
54468
54148
|
if (head.value.length === 0) {
|
|
54469
54149
|
node.children.shift();
|
|
54470
|
-
} else {
|
|
54471
|
-
|
|
54472
|
-
head.position.start.
|
|
54473
|
-
|
|
54474
|
-
head.position.start.offset++; // @ts-expect-error: must be true.
|
|
54475
|
-
|
|
54150
|
+
} else if (node.position && head.position && typeof head.position.start.offset === 'number') {
|
|
54151
|
+
head.position.start.column++;
|
|
54152
|
+
head.position.start.offset++;
|
|
54476
54153
|
node.position.start = Object.assign({}, head.position.start);
|
|
54477
54154
|
}
|
|
54478
54155
|
}
|
|
@@ -54486,11 +54163,19 @@ function exitParagraphWithTaskListItem(token) {
|
|
|
54486
54163
|
*/
|
|
54487
54164
|
|
|
54488
54165
|
|
|
54489
|
-
function listItemWithTaskListItem(node, parent, context) {
|
|
54166
|
+
function listItemWithTaskListItem(node, parent, context, safeOptions) {
|
|
54490
54167
|
var head = node.children[0];
|
|
54491
|
-
var
|
|
54168
|
+
var checkable = typeof node.checked === 'boolean' && head && head.type === 'paragraph';
|
|
54169
|
+
var checkbox = '[' + (node.checked ? 'x' : ' ') + '] ';
|
|
54170
|
+
var tracker = track(safeOptions);
|
|
54171
|
+
|
|
54172
|
+
if (checkable) {
|
|
54173
|
+
tracker.move(checkbox);
|
|
54174
|
+
}
|
|
54492
54175
|
|
|
54493
|
-
|
|
54176
|
+
var value = list_item_listItem(node, parent, context, _objectSpread2(_objectSpread2({}, safeOptions), tracker.current()));
|
|
54177
|
+
|
|
54178
|
+
if (checkable) {
|
|
54494
54179
|
value = value.replace(/^(?:[*+-]|\d+\.)([\r\n]| {1,3})/, check);
|
|
54495
54180
|
}
|
|
54496
54181
|
|
|
@@ -54501,7 +54186,7 @@ function listItemWithTaskListItem(node, parent, context) {
|
|
|
54501
54186
|
*/
|
|
54502
54187
|
|
|
54503
54188
|
function check($0) {
|
|
54504
|
-
return $0 +
|
|
54189
|
+
return $0 + checkbox;
|
|
54505
54190
|
}
|
|
54506
54191
|
}
|
|
54507
54192
|
;// CONCATENATED MODULE: ./node_modules/mdast-util-gfm/index.js
|
|
@@ -68016,7 +67701,7 @@ var rehypeRewriteHandle = function rehypeRewriteHandle(node, index, parent) {
|
|
|
68016
67701
|
var child = node.children && node.children[0];
|
|
68017
67702
|
|
|
68018
67703
|
if (child && child.properties && child.properties.ariaHidden === 'true') {
|
|
68019
|
-
child.properties =
|
|
67704
|
+
child.properties = extends_extends({
|
|
68020
67705
|
class: 'anchor'
|
|
68021
67706
|
}, child.properties);
|
|
68022
67707
|
child.children = [octiconLink];
|
|
@@ -68058,23 +67743,23 @@ var getCodeStr = function getCodeStr(data, code) {
|
|
|
68058
67743
|
onMouseOver = props.onMouseOver,
|
|
68059
67744
|
_props$warpperElement = props.warpperElement,
|
|
68060
67745
|
warpperElement = _props$warpperElement === void 0 ? {} : _props$warpperElement,
|
|
68061
|
-
other =
|
|
67746
|
+
other = objectWithoutPropertiesLoose_objectWithoutPropertiesLoose(props, _excluded);
|
|
68062
67747
|
|
|
68063
67748
|
var mdp = /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_default().createRef();
|
|
68064
67749
|
(0,external_root_React_commonjs2_react_commonjs_react_amd_react_.useImperativeHandle)(ref, function () {
|
|
68065
|
-
return
|
|
67750
|
+
return extends_extends({}, props, {
|
|
68066
67751
|
mdp: mdp
|
|
68067
67752
|
});
|
|
68068
67753
|
}, [mdp, props]);
|
|
68069
67754
|
var cls = (prefixCls || '') + " " + (className || '');
|
|
68070
|
-
return /*#__PURE__*/(0,jsx_runtime.jsx)("div",
|
|
67755
|
+
return /*#__PURE__*/(0,jsx_runtime.jsx)("div", extends_extends({
|
|
68071
67756
|
ref: mdp,
|
|
68072
67757
|
onScroll: onScroll,
|
|
68073
67758
|
onMouseOver: onMouseOver
|
|
68074
67759
|
}, warpperElement, {
|
|
68075
67760
|
className: cls,
|
|
68076
67761
|
style: style,
|
|
68077
|
-
children: /*#__PURE__*/(0,jsx_runtime.jsx)(ReactMarkdown,
|
|
67762
|
+
children: /*#__PURE__*/(0,jsx_runtime.jsx)(ReactMarkdown, extends_extends({}, other, {
|
|
68078
67763
|
rehypePlugins: [[(rehype_prism_default()), {
|
|
68079
67764
|
ignoreMissing: true
|
|
68080
67765
|
}], rehypeRaw, rehypeSlug, rehypeAutolinkHeadings, [rehype_rewrite_lib, {
|
|
@@ -68470,7 +68155,7 @@ var fatalities = {
|
|
|
68470
68155
|
1: false,
|
|
68471
68156
|
0: null
|
|
68472
68157
|
};
|
|
68473
|
-
/** @type {import('unified').Plugin<[Options?] | void
|
|
68158
|
+
/** @type {import('unified').Plugin<[Options?] | Array<void>, string, Root>} */
|
|
68474
68159
|
|
|
68475
68160
|
function rehypeParse(options) {
|
|
68476
68161
|
var processorSettings =
|
|
@@ -68566,9 +68251,6 @@ function lib_camelcase(value) {
|
|
|
68566
68251
|
return $0.charAt(1).toUpperCase();
|
|
68567
68252
|
});
|
|
68568
68253
|
}
|
|
68569
|
-
;// CONCATENATED MODULE: ./node_modules/rehype-parse/index.js
|
|
68570
|
-
|
|
68571
|
-
/* harmony default export */ var rehype_parse = (rehypeParse);
|
|
68572
68254
|
;// CONCATENATED MODULE: ./node_modules/hast-util-to-html/node_modules/property-information/lib/util/schema.js
|
|
68573
68255
|
|
|
68574
68256
|
|
|
@@ -71568,7 +71250,7 @@ function toHtml(node) {
|
|
|
71568
71250
|
* @typedef {import('hast-util-to-html').Options} Options
|
|
71569
71251
|
*/
|
|
71570
71252
|
|
|
71571
|
-
/** @type {import('unified').Plugin<[Options]|void
|
|
71253
|
+
/** @type {import('unified').Plugin<[Options?]|Array<void>, Node, string>} */
|
|
71572
71254
|
|
|
71573
71255
|
function rehypeStringify(config) {
|
|
71574
71256
|
var processorSettings =
|
|
@@ -71586,14 +71268,11 @@ function rehypeStringify(config) {
|
|
|
71586
71268
|
return toHtml(tree, settings);
|
|
71587
71269
|
}
|
|
71588
71270
|
}
|
|
71589
|
-
;// CONCATENATED MODULE: ./node_modules/rehype-stringify/index.js
|
|
71590
|
-
|
|
71591
|
-
/* harmony default export */ var rehype_stringify = (rehypeStringify);
|
|
71592
71271
|
;// CONCATENATED MODULE: ./node_modules/rehype/index.js
|
|
71593
71272
|
|
|
71594
71273
|
|
|
71595
71274
|
|
|
71596
|
-
var rehype = unified().use(
|
|
71275
|
+
var rehype = unified().use(rehypeParse).use(rehypeStringify).freeze();
|
|
71597
71276
|
;// CONCATENATED MODULE: ./esm/components/TextArea/Markdown.js
|
|
71598
71277
|
|
|
71599
71278
|
// @ts-ignore
|