@readme/markdown 13.2.0 → 13.3.0
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/lib/mdast-util/legacy-variable/index.d.ts +2 -0
- package/dist/lib/mdxish.d.ts +2 -1
- package/dist/lib/micromark/legacy-variable/index.d.ts +4 -0
- package/dist/lib/micromark/legacy-variable/syntax.d.ts +10 -0
- package/dist/lib/plain.d.ts +6 -0
- package/dist/main.js +466 -185
- package/dist/main.node.js +466 -185
- package/dist/main.node.js.map +1 -1
- package/dist/processor/transform/mdxish/heading-slugs.d.ts +8 -0
- package/dist/processor/transform/mdxish/variables-code.d.ts +14 -0
- package/package.json +3 -2
package/dist/main.js
CHANGED
|
@@ -12538,12 +12538,12 @@ var parseOptions = function parseOptions() {
|
|
|
12538
12538
|
return opts;
|
|
12539
12539
|
};
|
|
12540
12540
|
|
|
12541
|
-
;// ./node_modules/
|
|
12541
|
+
;// ./node_modules/github-slugger/regex.js
|
|
12542
12542
|
// This module is generated by `script/`.
|
|
12543
12543
|
/* eslint-disable no-control-regex, no-misleading-character-class, no-useless-escape */
|
|
12544
12544
|
const regex = /[\0-\x1F!-,\.\/:-@\[-\^`\{-\xA9\xAB-\xB4\xB6-\xB9\xBB-\xBF\xD7\xF7\u02C2-\u02C5\u02D2-\u02DF\u02E5-\u02EB\u02ED\u02EF-\u02FF\u0375\u0378\u0379\u037E\u0380-\u0385\u0387\u038B\u038D\u03A2\u03F6\u0482\u0530\u0557\u0558\u055A-\u055F\u0589-\u0590\u05BE\u05C0\u05C3\u05C6\u05C8-\u05CF\u05EB-\u05EE\u05F3-\u060F\u061B-\u061F\u066A-\u066D\u06D4\u06DD\u06DE\u06E9\u06FD\u06FE\u0700-\u070F\u074B\u074C\u07B2-\u07BF\u07F6-\u07F9\u07FB\u07FC\u07FE\u07FF\u082E-\u083F\u085C-\u085F\u086B-\u089F\u08B5\u08C8-\u08D2\u08E2\u0964\u0965\u0970\u0984\u098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0DD5\u0DD7\u0DE0-\u0DE5\u0DF0\u0DF1\u0DF4-\u0E00\u0E3B-\u0E3F\u0E4F\u0E5A-\u0E80\u0E83\u0E85\u0E8B\u0EA4\u0EA6\u0EBE\u0EBF\u0EC5\u0EC7\u0ECE\u0ECF\u0EDA\u0EDB\u0EE0-\u0EFF\u0F01-\u0F17\u0F1A-\u0F1F\u0F2A-\u0F34\u0F36\u0F38\u0F3A-\u0F3D\u0F48\u0F6D-\u0F70\u0F85\u0F98\u0FBD-\u0FC5\u0FC7-\u0FFF\u104A-\u104F\u109E\u109F\u10C6\u10C8-\u10CC\u10CE\u10CF\u10FB\u1249\u124E\u124F\u1257\u1259\u125E\u125F\u1289\u128E\u128F\u12B1\u12B6\u12B7\u12BF\u12C1\u12C6\u12C7\u12D7\u1311\u1316\u1317\u135B\u135C\u1360-\u137F\u1390-\u139F\u13F6\u13F7\u13FE-\u1400\u166D\u166E\u1680\u169B-\u169F\u16EB-\u16ED\u16F9-\u16FF\u170D\u1715-\u171F\u1735-\u173F\u1754-\u175F\u176D\u1771\u1774-\u177F\u17D4-\u17D6\u17D8-\u17DB\u17DE\u17DF\u17EA-\u180A\u180E\u180F\u181A-\u181F\u1879-\u187F\u18AB-\u18AF\u18F6-\u18FF\u191F\u192C-\u192F\u193C-\u1945\u196E\u196F\u1975-\u197F\u19AC-\u19AF\u19CA-\u19CF\u19DA-\u19FF\u1A1C-\u1A1F\u1A5F\u1A7D\u1A7E\u1A8A-\u1A8F\u1A9A-\u1AA6\u1AA8-\u1AAF\u1AC1-\u1AFF\u1B4C-\u1B4F\u1B5A-\u1B6A\u1B74-\u1B7F\u1BF4-\u1BFF\u1C38-\u1C3F\u1C4A-\u1C4C\u1C7E\u1C7F\u1C89-\u1C8F\u1CBB\u1CBC\u1CC0-\u1CCF\u1CD3\u1CFB-\u1CFF\u1DFA\u1F16\u1F17\u1F1E\u1F1F\u1F46\u1F47\u1F4E\u1F4F\u1F58\u1F5A\u1F5C\u1F5E\u1F7E\u1F7F\u1FB5\u1FBD\u1FBF-\u1FC1\u1FC5\u1FCD-\u1FCF\u1FD4\u1FD5\u1FDC-\u1FDF\u1FED-\u1FF1\u1FF5\u1FFD-\u203E\u2041-\u2053\u2055-\u2070\u2072-\u207E\u2080-\u208F\u209D-\u20CF\u20F1-\u2101\u2103-\u2106\u2108\u2109\u2114\u2116-\u2118\u211E-\u2123\u2125\u2127\u2129\u212E\u213A\u213B\u2140-\u2144\u214A-\u214D\u214F-\u215F\u2189-\u24B5\u24EA-\u2BFF\u2C2F\u2C5F\u2CE5-\u2CEA\u2CF4-\u2CFF\u2D26\u2D28-\u2D2C\u2D2E\u2D2F\u2D68-\u2D6E\u2D70-\u2D7E\u2D97-\u2D9F\u2DA7\u2DAF\u2DB7\u2DBF\u2DC7\u2DCF\u2DD7\u2DDF\u2E00-\u2E2E\u2E30-\u3004\u3008-\u3020\u3030\u3036\u3037\u303D-\u3040\u3097\u3098\u309B\u309C\u30A0\u30FB\u3100-\u3104\u3130\u318F-\u319F\u31C0-\u31EF\u3200-\u33FF\u4DC0-\u4DFF\u9FFD-\u9FFF\uA48D-\uA4CF\uA4FE\uA4FF\uA60D-\uA60F\uA62C-\uA63F\uA673\uA67E\uA6F2-\uA716\uA720\uA721\uA789\uA78A\uA7C0\uA7C1\uA7CB-\uA7F4\uA828-\uA82B\uA82D-\uA83F\uA874-\uA87F\uA8C6-\uA8CF\uA8DA-\uA8DF\uA8F8-\uA8FA\uA8FC\uA92E\uA92F\uA954-\uA95F\uA97D-\uA97F\uA9C1-\uA9CE\uA9DA-\uA9DF\uA9FF\uAA37-\uAA3F\uAA4E\uAA4F\uAA5A-\uAA5F\uAA77-\uAA79\uAAC3-\uAADA\uAADE\uAADF\uAAF0\uAAF1\uAAF7-\uAB00\uAB07\uAB08\uAB0F\uAB10\uAB17-\uAB1F\uAB27\uAB2F\uAB5B\uAB6A-\uAB6F\uABEB\uABEE\uABEF\uABFA-\uABFF\uD7A4-\uD7AF\uD7C7-\uD7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89\uDFA9\uDFC3\uDFCC\uDFCD]|\uD836[\uDC00-\uDDFF\uDE37-\uDE3A\uDE6D-\uDE74\uDE76-\uDE83\uDE85-\uDE9A\uDEA0\uDEB0-\uDFFF]|\uD838[\uDC07\uDC19\uDC1A\uDC22\uDC25\uDC2B-\uDCFF\uDD2D-\uDD2F\uDD3E\uDD3F\uDD4A-\uDD4D\uDD4F-\uDEBF\uDEFA-\uDFFF]|\uD83A[\uDCC5-\uDCCF\uDCD7-\uDCFF\uDD4C-\uDD4F\uDD5A-\uDFFF]|\uD83B[\uDC00-\uDDFF\uDE04\uDE20\uDE23\uDE25\uDE26\uDE28\uDE33\uDE38\uDE3A\uDE3C-\uDE41\uDE43-\uDE46\uDE48\uDE4A\uDE4C\uDE50\uDE53\uDE55\uDE56\uDE58\uDE5A\uDE5C\uDE5E\uDE60\uDE63\uDE65\uDE66\uDE6B\uDE73\uDE78\uDE7D\uDE7F\uDE8A\uDE9C-\uDEA0\uDEA4\uDEAA\uDEBC-\uDFFF]|\uD83C[\uDC00-\uDD2F\uDD4A-\uDD4F\uDD6A-\uDD6F\uDD8A-\uDFFF]|\uD83E[\uDC00-\uDFEF\uDFFA-\uDFFF]|\uD869[\uDEDE-\uDEFF]|\uD86D[\uDF35-\uDF3F]|\uD86E[\uDC1E\uDC1F]|\uD873[\uDEA2-\uDEAF]|\uD87A[\uDFE1-\uDFFF]|\uD87E[\uDE1E-\uDFFF]|\uD884[\uDF4B-\uDFFF]|\uDB40[\uDC00-\uDCFF\uDDF0-\uDFFF]/g
|
|
12545
12545
|
|
|
12546
|
-
;// ./node_modules/
|
|
12546
|
+
;// ./node_modules/github-slugger/index.js
|
|
12547
12547
|
|
|
12548
12548
|
|
|
12549
12549
|
const own = Object.hasOwnProperty
|
|
@@ -52986,6 +52986,8 @@ function plain_one(node, opts) {
|
|
|
52986
52986
|
case 'variable':
|
|
52987
52987
|
case 'Variable': {
|
|
52988
52988
|
const key = node.properties.name.toString();
|
|
52989
|
+
if (opts.preserveVariableSyntax)
|
|
52990
|
+
return `{user.${key}}`;
|
|
52989
52991
|
const val = 'variables' in opts && opts.variables[key];
|
|
52990
52992
|
return val || key;
|
|
52991
52993
|
}
|
|
@@ -53009,6 +53011,8 @@ function plain_one(node, opts) {
|
|
|
53009
53011
|
if (node.type === 'mdxTextExpression') {
|
|
53010
53012
|
const key = extractMdxVariableKey(node);
|
|
53011
53013
|
if (key) {
|
|
53014
|
+
if (opts.preserveVariableSyntax)
|
|
53015
|
+
return `{user.${key}}`;
|
|
53012
53016
|
return ('variables' in opts && opts.variables[key]) || key;
|
|
53013
53017
|
}
|
|
53014
53018
|
}
|
|
@@ -70833,9 +70837,320 @@ const mdxToHast = () => tree => {
|
|
|
70833
70837
|
};
|
|
70834
70838
|
/* harmony default export */ const mdx_to_hast = (mdxToHast);
|
|
70835
70839
|
|
|
70840
|
+
;// ./lib/mdast-util/legacy-variable/index.ts
|
|
70841
|
+
|
|
70842
|
+
const contextMap = new WeakMap();
|
|
70843
|
+
function findlegacyVariableToken() {
|
|
70844
|
+
// tokenStack is micromark's current open token ancestry; find the nearest legacyVariable token.
|
|
70845
|
+
const events = this.tokenStack;
|
|
70846
|
+
for (let i = events.length - 1; i >= 0; i -= 1) {
|
|
70847
|
+
const token = events[i][0];
|
|
70848
|
+
if (token.type === 'legacyVariable')
|
|
70849
|
+
return token;
|
|
70850
|
+
}
|
|
70851
|
+
return undefined;
|
|
70852
|
+
}
|
|
70853
|
+
function enterlegacyVariable(token) {
|
|
70854
|
+
contextMap.set(token, { value: '' });
|
|
70855
|
+
}
|
|
70856
|
+
function exitlegacyVariableValue(token) {
|
|
70857
|
+
const variableToken = findlegacyVariableToken.call(this);
|
|
70858
|
+
if (!variableToken)
|
|
70859
|
+
return;
|
|
70860
|
+
const ctx = contextMap.get(variableToken);
|
|
70861
|
+
// Build up the variable characters
|
|
70862
|
+
if (ctx)
|
|
70863
|
+
ctx.value += this.sliceSerialize(token);
|
|
70864
|
+
}
|
|
70865
|
+
function exitlegacyVariable(token) {
|
|
70866
|
+
const ctx = contextMap.get(token);
|
|
70867
|
+
const serialized = this.sliceSerialize(token);
|
|
70868
|
+
const variableName = serialized.startsWith('<<') && serialized.endsWith('>>')
|
|
70869
|
+
? serialized.slice(2, -2)
|
|
70870
|
+
: ctx?.value ?? '';
|
|
70871
|
+
const nodePosition = {
|
|
70872
|
+
start: {
|
|
70873
|
+
offset: token.start.offset,
|
|
70874
|
+
line: token.start.line,
|
|
70875
|
+
column: token.start.column,
|
|
70876
|
+
},
|
|
70877
|
+
end: {
|
|
70878
|
+
offset: token.end.offset,
|
|
70879
|
+
line: token.end.line,
|
|
70880
|
+
column: token.end.column,
|
|
70881
|
+
},
|
|
70882
|
+
};
|
|
70883
|
+
if (variableName.startsWith('glossary:')) {
|
|
70884
|
+
const term = variableName.slice('glossary:'.length).trim();
|
|
70885
|
+
this.enter({
|
|
70886
|
+
type: NodeTypes.glossary,
|
|
70887
|
+
data: {
|
|
70888
|
+
hName: 'Glossary',
|
|
70889
|
+
hProperties: { term },
|
|
70890
|
+
},
|
|
70891
|
+
children: [{ type: 'text', value: term }],
|
|
70892
|
+
position: nodePosition,
|
|
70893
|
+
}, token);
|
|
70894
|
+
this.exit(token);
|
|
70895
|
+
contextMap.delete(token);
|
|
70896
|
+
return;
|
|
70897
|
+
}
|
|
70898
|
+
this.enter({
|
|
70899
|
+
type: NodeTypes.variable,
|
|
70900
|
+
data: {
|
|
70901
|
+
hName: 'Variable',
|
|
70902
|
+
hProperties: { name: variableName.trim(), isLegacy: true },
|
|
70903
|
+
},
|
|
70904
|
+
value: `<<${variableName}>>`,
|
|
70905
|
+
}, token);
|
|
70906
|
+
this.exit(token);
|
|
70907
|
+
contextMap.delete(token);
|
|
70908
|
+
}
|
|
70909
|
+
function legacyVariableFromMarkdown() {
|
|
70910
|
+
return {
|
|
70911
|
+
enter: {
|
|
70912
|
+
legacyVariable: enterlegacyVariable,
|
|
70913
|
+
},
|
|
70914
|
+
exit: {
|
|
70915
|
+
legacyVariableValue: exitlegacyVariableValue,
|
|
70916
|
+
legacyVariable: exitlegacyVariable,
|
|
70917
|
+
},
|
|
70918
|
+
};
|
|
70919
|
+
}
|
|
70920
|
+
|
|
70921
|
+
;// ./node_modules/micromark-util-symbol/lib/codes.js
|
|
70922
|
+
/**
|
|
70923
|
+
* Character codes.
|
|
70924
|
+
*
|
|
70925
|
+
* This module is compiled away!
|
|
70926
|
+
*
|
|
70927
|
+
* micromark works based on character codes.
|
|
70928
|
+
* This module contains constants for the ASCII block and the replacement
|
|
70929
|
+
* character.
|
|
70930
|
+
* A couple of them are handled in a special way, such as the line endings
|
|
70931
|
+
* (CR, LF, and CR+LF, commonly known as end-of-line: EOLs), the tab (horizontal
|
|
70932
|
+
* tab) and its expansion based on what column it’s at (virtual space),
|
|
70933
|
+
* and the end-of-file (eof) character.
|
|
70934
|
+
* As values are preprocessed before handling them, the actual characters LF,
|
|
70935
|
+
* CR, HT, and NUL (which is present as the replacement character), are
|
|
70936
|
+
* guaranteed to not exist.
|
|
70937
|
+
*
|
|
70938
|
+
* Unicode basic latin block.
|
|
70939
|
+
*/
|
|
70940
|
+
const codes = /** @type {const} */ ({
|
|
70941
|
+
carriageReturn: -5,
|
|
70942
|
+
lineFeed: -4,
|
|
70943
|
+
carriageReturnLineFeed: -3,
|
|
70944
|
+
horizontalTab: -2,
|
|
70945
|
+
virtualSpace: -1,
|
|
70946
|
+
eof: null,
|
|
70947
|
+
nul: 0,
|
|
70948
|
+
soh: 1,
|
|
70949
|
+
stx: 2,
|
|
70950
|
+
etx: 3,
|
|
70951
|
+
eot: 4,
|
|
70952
|
+
enq: 5,
|
|
70953
|
+
ack: 6,
|
|
70954
|
+
bel: 7,
|
|
70955
|
+
bs: 8,
|
|
70956
|
+
ht: 9, // `\t`
|
|
70957
|
+
lf: 10, // `\n`
|
|
70958
|
+
vt: 11, // `\v`
|
|
70959
|
+
ff: 12, // `\f`
|
|
70960
|
+
cr: 13, // `\r`
|
|
70961
|
+
so: 14,
|
|
70962
|
+
si: 15,
|
|
70963
|
+
dle: 16,
|
|
70964
|
+
dc1: 17,
|
|
70965
|
+
dc2: 18,
|
|
70966
|
+
dc3: 19,
|
|
70967
|
+
dc4: 20,
|
|
70968
|
+
nak: 21,
|
|
70969
|
+
syn: 22,
|
|
70970
|
+
etb: 23,
|
|
70971
|
+
can: 24,
|
|
70972
|
+
em: 25,
|
|
70973
|
+
sub: 26,
|
|
70974
|
+
esc: 27,
|
|
70975
|
+
fs: 28,
|
|
70976
|
+
gs: 29,
|
|
70977
|
+
rs: 30,
|
|
70978
|
+
us: 31,
|
|
70979
|
+
space: 32,
|
|
70980
|
+
exclamationMark: 33, // `!`
|
|
70981
|
+
quotationMark: 34, // `"`
|
|
70982
|
+
numberSign: 35, // `#`
|
|
70983
|
+
dollarSign: 36, // `$`
|
|
70984
|
+
percentSign: 37, // `%`
|
|
70985
|
+
ampersand: 38, // `&`
|
|
70986
|
+
apostrophe: 39, // `'`
|
|
70987
|
+
leftParenthesis: 40, // `(`
|
|
70988
|
+
rightParenthesis: 41, // `)`
|
|
70989
|
+
asterisk: 42, // `*`
|
|
70990
|
+
plusSign: 43, // `+`
|
|
70991
|
+
comma: 44, // `,`
|
|
70992
|
+
dash: 45, // `-`
|
|
70993
|
+
dot: 46, // `.`
|
|
70994
|
+
slash: 47, // `/`
|
|
70995
|
+
digit0: 48, // `0`
|
|
70996
|
+
digit1: 49, // `1`
|
|
70997
|
+
digit2: 50, // `2`
|
|
70998
|
+
digit3: 51, // `3`
|
|
70999
|
+
digit4: 52, // `4`
|
|
71000
|
+
digit5: 53, // `5`
|
|
71001
|
+
digit6: 54, // `6`
|
|
71002
|
+
digit7: 55, // `7`
|
|
71003
|
+
digit8: 56, // `8`
|
|
71004
|
+
digit9: 57, // `9`
|
|
71005
|
+
colon: 58, // `:`
|
|
71006
|
+
semicolon: 59, // `;`
|
|
71007
|
+
lessThan: 60, // `<`
|
|
71008
|
+
equalsTo: 61, // `=`
|
|
71009
|
+
greaterThan: 62, // `>`
|
|
71010
|
+
questionMark: 63, // `?`
|
|
71011
|
+
atSign: 64, // `@`
|
|
71012
|
+
uppercaseA: 65, // `A`
|
|
71013
|
+
uppercaseB: 66, // `B`
|
|
71014
|
+
uppercaseC: 67, // `C`
|
|
71015
|
+
uppercaseD: 68, // `D`
|
|
71016
|
+
uppercaseE: 69, // `E`
|
|
71017
|
+
uppercaseF: 70, // `F`
|
|
71018
|
+
uppercaseG: 71, // `G`
|
|
71019
|
+
uppercaseH: 72, // `H`
|
|
71020
|
+
uppercaseI: 73, // `I`
|
|
71021
|
+
uppercaseJ: 74, // `J`
|
|
71022
|
+
uppercaseK: 75, // `K`
|
|
71023
|
+
uppercaseL: 76, // `L`
|
|
71024
|
+
uppercaseM: 77, // `M`
|
|
71025
|
+
uppercaseN: 78, // `N`
|
|
71026
|
+
uppercaseO: 79, // `O`
|
|
71027
|
+
uppercaseP: 80, // `P`
|
|
71028
|
+
uppercaseQ: 81, // `Q`
|
|
71029
|
+
uppercaseR: 82, // `R`
|
|
71030
|
+
uppercaseS: 83, // `S`
|
|
71031
|
+
uppercaseT: 84, // `T`
|
|
71032
|
+
uppercaseU: 85, // `U`
|
|
71033
|
+
uppercaseV: 86, // `V`
|
|
71034
|
+
uppercaseW: 87, // `W`
|
|
71035
|
+
uppercaseX: 88, // `X`
|
|
71036
|
+
uppercaseY: 89, // `Y`
|
|
71037
|
+
uppercaseZ: 90, // `Z`
|
|
71038
|
+
leftSquareBracket: 91, // `[`
|
|
71039
|
+
backslash: 92, // `\`
|
|
71040
|
+
rightSquareBracket: 93, // `]`
|
|
71041
|
+
caret: 94, // `^`
|
|
71042
|
+
underscore: 95, // `_`
|
|
71043
|
+
graveAccent: 96, // `` ` ``
|
|
71044
|
+
lowercaseA: 97, // `a`
|
|
71045
|
+
lowercaseB: 98, // `b`
|
|
71046
|
+
lowercaseC: 99, // `c`
|
|
71047
|
+
lowercaseD: 100, // `d`
|
|
71048
|
+
lowercaseE: 101, // `e`
|
|
71049
|
+
lowercaseF: 102, // `f`
|
|
71050
|
+
lowercaseG: 103, // `g`
|
|
71051
|
+
lowercaseH: 104, // `h`
|
|
71052
|
+
lowercaseI: 105, // `i`
|
|
71053
|
+
lowercaseJ: 106, // `j`
|
|
71054
|
+
lowercaseK: 107, // `k`
|
|
71055
|
+
lowercaseL: 108, // `l`
|
|
71056
|
+
lowercaseM: 109, // `m`
|
|
71057
|
+
lowercaseN: 110, // `n`
|
|
71058
|
+
lowercaseO: 111, // `o`
|
|
71059
|
+
lowercaseP: 112, // `p`
|
|
71060
|
+
lowercaseQ: 113, // `q`
|
|
71061
|
+
lowercaseR: 114, // `r`
|
|
71062
|
+
lowercaseS: 115, // `s`
|
|
71063
|
+
lowercaseT: 116, // `t`
|
|
71064
|
+
lowercaseU: 117, // `u`
|
|
71065
|
+
lowercaseV: 118, // `v`
|
|
71066
|
+
lowercaseW: 119, // `w`
|
|
71067
|
+
lowercaseX: 120, // `x`
|
|
71068
|
+
lowercaseY: 121, // `y`
|
|
71069
|
+
lowercaseZ: 122, // `z`
|
|
71070
|
+
leftCurlyBrace: 123, // `{`
|
|
71071
|
+
verticalBar: 124, // `|`
|
|
71072
|
+
rightCurlyBrace: 125, // `}`
|
|
71073
|
+
tilde: 126, // `~`
|
|
71074
|
+
del: 127,
|
|
71075
|
+
// Unicode Specials block.
|
|
71076
|
+
byteOrderMarker: 65_279,
|
|
71077
|
+
// Unicode Specials block.
|
|
71078
|
+
replacementCharacter: 65_533 // `�`
|
|
71079
|
+
})
|
|
71080
|
+
|
|
71081
|
+
;// ./lib/micromark/legacy-variable/syntax.ts
|
|
71082
|
+
|
|
71083
|
+
|
|
71084
|
+
function isAllowedValueChar(code) {
|
|
71085
|
+
return (code !== null &&
|
|
71086
|
+
code !== codes.lessThan &&
|
|
71087
|
+
code !== codes.greaterThan &&
|
|
71088
|
+
!markdownLineEnding(code));
|
|
71089
|
+
}
|
|
71090
|
+
const legacyVariableConstruct = {
|
|
71091
|
+
name: 'legacyVariable',
|
|
71092
|
+
tokenize,
|
|
71093
|
+
};
|
|
71094
|
+
function tokenize(effects, ok, nok) {
|
|
71095
|
+
let hasValue = false;
|
|
71096
|
+
const start = (code) => {
|
|
71097
|
+
if (code !== codes.lessThan)
|
|
71098
|
+
return nok(code);
|
|
71099
|
+
effects.enter('legacyVariable');
|
|
71100
|
+
effects.enter('legacyVariableMarkerStart');
|
|
71101
|
+
effects.consume(code); // <
|
|
71102
|
+
return open2;
|
|
71103
|
+
};
|
|
71104
|
+
const open2 = (code) => {
|
|
71105
|
+
if (code !== codes.lessThan)
|
|
71106
|
+
return nok(code);
|
|
71107
|
+
effects.consume(code); // <<
|
|
71108
|
+
effects.exit('legacyVariableMarkerStart');
|
|
71109
|
+
effects.enter('legacyVariableValue');
|
|
71110
|
+
return value;
|
|
71111
|
+
};
|
|
71112
|
+
const value = (code) => {
|
|
71113
|
+
if (code === codes.greaterThan) {
|
|
71114
|
+
if (!hasValue)
|
|
71115
|
+
return nok(code);
|
|
71116
|
+
effects.exit('legacyVariableValue');
|
|
71117
|
+
effects.enter('legacyVariableMarkerEnd');
|
|
71118
|
+
effects.consume(code); // >
|
|
71119
|
+
return close2;
|
|
71120
|
+
}
|
|
71121
|
+
if (!isAllowedValueChar(code))
|
|
71122
|
+
return nok(code);
|
|
71123
|
+
hasValue = true;
|
|
71124
|
+
effects.consume(code);
|
|
71125
|
+
return value;
|
|
71126
|
+
};
|
|
71127
|
+
const close2 = (code) => {
|
|
71128
|
+
if (code !== codes.greaterThan)
|
|
71129
|
+
return nok(code);
|
|
71130
|
+
effects.consume(code); // >>
|
|
71131
|
+
effects.exit('legacyVariableMarkerEnd');
|
|
71132
|
+
effects.exit('legacyVariable');
|
|
71133
|
+
return ok;
|
|
71134
|
+
};
|
|
71135
|
+
return start;
|
|
71136
|
+
}
|
|
71137
|
+
function legacyVariable() {
|
|
71138
|
+
return {
|
|
71139
|
+
text: { [codes.lessThan]: legacyVariableConstruct },
|
|
71140
|
+
};
|
|
71141
|
+
}
|
|
71142
|
+
|
|
71143
|
+
;// ./lib/micromark/legacy-variable/index.ts
|
|
71144
|
+
/**
|
|
71145
|
+
* Micromark extension for <<variable>> / <<glossary:term>> inline syntax.
|
|
71146
|
+
*/
|
|
71147
|
+
|
|
71148
|
+
|
|
70836
71149
|
;// ./processor/transform/mdxish/mdxish-component-blocks.ts
|
|
70837
71150
|
|
|
70838
71151
|
|
|
71152
|
+
|
|
71153
|
+
|
|
70839
71154
|
const pascalCaseTagPattern = /^<([A-Z][A-Za-z0-9_]*)([^>]*?)(\/?)>([\s\S]*)?$/;
|
|
70840
71155
|
const tagAttributePattern = /([a-zA-Z_:][-a-zA-Z0-9_:.]*)(?:\s*=\s*("[^"]*"|'[^']*'|[^\s"'>]+))?/g;
|
|
70841
71156
|
/**
|
|
@@ -70852,7 +71167,10 @@ const MAX_LOOKAHEAD = 30;
|
|
|
70852
71167
|
* Glossary and Anchor are inline components.
|
|
70853
71168
|
*/
|
|
70854
71169
|
const EXCLUDED_TAGS = new Set(['HTMLBlock', 'Table', 'Glossary', 'Anchor']);
|
|
70855
|
-
const inlineMdProcessor = unified()
|
|
71170
|
+
const inlineMdProcessor = unified()
|
|
71171
|
+
.data('micromarkExtensions', [legacyVariable()])
|
|
71172
|
+
.data('fromMarkdownExtensions', [legacyVariableFromMarkdown()])
|
|
71173
|
+
.use(remarkParse);
|
|
70856
71174
|
const isClosingTag = (value, tag) => value.trim() === `</${tag}>`;
|
|
70857
71175
|
/**
|
|
70858
71176
|
* Parse markdown content into mdast children nodes.
|
|
@@ -71959,6 +72277,7 @@ const variables = ({ asMdx } = { asMdx: true }) => tree => {
|
|
|
71959
72277
|
const name = expression.expression.property.type === 'Identifier'
|
|
71960
72278
|
? expression.expression.property.name
|
|
71961
72279
|
: expression.expression.property.value;
|
|
72280
|
+
const position = 'position' in node ? node.position : undefined;
|
|
71962
72281
|
const variable = asMdx
|
|
71963
72282
|
? {
|
|
71964
72283
|
type: 'mdxJsxTextElement',
|
|
@@ -71971,7 +72290,7 @@ const variables = ({ asMdx } = { asMdx: true }) => tree => {
|
|
|
71971
72290
|
},
|
|
71972
72291
|
],
|
|
71973
72292
|
children: [],
|
|
71974
|
-
position
|
|
72293
|
+
position,
|
|
71975
72294
|
}
|
|
71976
72295
|
: {
|
|
71977
72296
|
type: NodeTypes.variable,
|
|
@@ -71982,7 +72301,7 @@ const variables = ({ asMdx } = { asMdx: true }) => tree => {
|
|
|
71982
72301
|
},
|
|
71983
72302
|
},
|
|
71984
72303
|
value: `{${node.value}}`,
|
|
71985
|
-
position
|
|
72304
|
+
position,
|
|
71986
72305
|
};
|
|
71987
72306
|
parent.children.splice(index, 1, variable);
|
|
71988
72307
|
});
|
|
@@ -94026,7 +94345,7 @@ const evaluateExpressions = ({ context = {} } = {}) => tree => {
|
|
|
94026
94345
|
parent.children.splice(index, 1, {
|
|
94027
94346
|
type: 'text',
|
|
94028
94347
|
value: textValue,
|
|
94029
|
-
position:
|
|
94348
|
+
position: expressionNode.position,
|
|
94030
94349
|
});
|
|
94031
94350
|
}
|
|
94032
94351
|
catch (_error) {
|
|
@@ -94037,7 +94356,7 @@ const evaluateExpressions = ({ context = {} } = {}) => tree => {
|
|
|
94037
94356
|
parent.children.splice(index, 1, {
|
|
94038
94357
|
type: 'text',
|
|
94039
94358
|
value: `{${processed}}`,
|
|
94040
|
-
position:
|
|
94359
|
+
position: expressionNode.position,
|
|
94041
94360
|
});
|
|
94042
94361
|
}
|
|
94043
94362
|
});
|
|
@@ -94045,6 +94364,43 @@ const evaluateExpressions = ({ context = {} } = {}) => tree => {
|
|
|
94045
94364
|
};
|
|
94046
94365
|
/* harmony default export */ const evaluate_expressions = (evaluateExpressions);
|
|
94047
94366
|
|
|
94367
|
+
;// ./processor/transform/mdxish/heading-slugs.ts
|
|
94368
|
+
|
|
94369
|
+
|
|
94370
|
+
function isHeading(node) {
|
|
94371
|
+
return /^h[1-6]$/.test(node.tagName);
|
|
94372
|
+
}
|
|
94373
|
+
function textContent(node) {
|
|
94374
|
+
if (node.type === 'text')
|
|
94375
|
+
return node.value;
|
|
94376
|
+
// Process variable nodes by using their variable name for the id generation
|
|
94377
|
+
if (node.type === 'element' && node.tagName === 'variable' && node.properties?.name) {
|
|
94378
|
+
if (node.properties.isLegacy) {
|
|
94379
|
+
return node.properties.name;
|
|
94380
|
+
}
|
|
94381
|
+
return `user.${node.properties.name}`;
|
|
94382
|
+
}
|
|
94383
|
+
if ('children' in node)
|
|
94384
|
+
return node.children.map(textContent).join('');
|
|
94385
|
+
return '';
|
|
94386
|
+
}
|
|
94387
|
+
/**
|
|
94388
|
+
* Rehype plugin that constructs ids for headings
|
|
94389
|
+
* Id's are used to construct slug anchor links & Table of Contents during rendering
|
|
94390
|
+
* Use the text / nodes that make up the heading to generate the id
|
|
94391
|
+
*/
|
|
94392
|
+
const generateSlugForHeadings = () => (tree) => {
|
|
94393
|
+
const slugger = new BananaSlug();
|
|
94394
|
+
visit(tree, 'element', (node) => {
|
|
94395
|
+
if (isHeading(node) && !node.properties.id) {
|
|
94396
|
+
const text = node.children.map(textContent).join('');
|
|
94397
|
+
node.properties.id = slugger.slug(text);
|
|
94398
|
+
}
|
|
94399
|
+
});
|
|
94400
|
+
return tree;
|
|
94401
|
+
};
|
|
94402
|
+
/* harmony default export */ const heading_slugs = (generateSlugForHeadings);
|
|
94403
|
+
|
|
94048
94404
|
;// ./node_modules/rehype-parse/lib/index.js
|
|
94049
94405
|
/**
|
|
94050
94406
|
* @import {Root} from 'hast'
|
|
@@ -94526,6 +94882,8 @@ const EMPTY_CODE_PLACEHOLDER = {
|
|
|
94526
94882
|
|
|
94527
94883
|
|
|
94528
94884
|
|
|
94885
|
+
|
|
94886
|
+
|
|
94529
94887
|
/**
|
|
94530
94888
|
* Wraps a node in a "pinned" container if sidebar: true is set.
|
|
94531
94889
|
*/
|
|
@@ -94564,9 +94922,17 @@ const preprocessBody = (text) => {
|
|
|
94564
94922
|
return ensureLeadingBreaks(text);
|
|
94565
94923
|
};
|
|
94566
94924
|
/** Markdown parser */
|
|
94567
|
-
const contentParser = unified()
|
|
94925
|
+
const contentParser = unified()
|
|
94926
|
+
.data('micromarkExtensions', [legacyVariable()])
|
|
94927
|
+
.data('fromMarkdownExtensions', [legacyVariableFromMarkdown()])
|
|
94928
|
+
.use(remarkParse)
|
|
94929
|
+
.use(remarkBreaks)
|
|
94930
|
+
.use(remarkGfm)
|
|
94931
|
+
.use(normalize_malformed_md_syntax);
|
|
94568
94932
|
/** Markdown to HTML processor (mdast → hast → HTML string) */
|
|
94569
94933
|
const markdownToHtml = unified()
|
|
94934
|
+
.data('micromarkExtensions', [legacyVariable()])
|
|
94935
|
+
.data('fromMarkdownExtensions', [legacyVariableFromMarkdown()])
|
|
94570
94936
|
.use(remarkParse)
|
|
94571
94937
|
.use(remarkGfm)
|
|
94572
94938
|
.use(normalize_malformed_md_syntax)
|
|
@@ -94679,7 +95045,13 @@ const parseTableCell = (text) => {
|
|
|
94679
95045
|
};
|
|
94680
95046
|
const parseBlock = (text) => {
|
|
94681
95047
|
if (!text.trim())
|
|
94682
|
-
return
|
|
95048
|
+
return textToBlock('');
|
|
95049
|
+
const tree = contentParser.runSync(contentParser.parse(text));
|
|
95050
|
+
return tree.children;
|
|
95051
|
+
};
|
|
95052
|
+
const parseInline = (text) => {
|
|
95053
|
+
if (!text.trim())
|
|
95054
|
+
return textToInline(text);
|
|
94683
95055
|
const tree = contentParser.runSync(contentParser.parse(text));
|
|
94684
95056
|
return tree.children;
|
|
94685
95057
|
};
|
|
@@ -94740,7 +95112,7 @@ function transformMagicBlock(blockType, data, rawValue, options = {}) {
|
|
|
94740
95112
|
const depth = headerJson.level || (compatibilityMode ? 1 : 2);
|
|
94741
95113
|
return [
|
|
94742
95114
|
wrapPinnedBlocks({
|
|
94743
|
-
children: 'title' in headerJson ?
|
|
95115
|
+
children: 'title' in headerJson ? parseInline(headerJson.title || '') : [],
|
|
94744
95116
|
depth,
|
|
94745
95117
|
type: 'heading',
|
|
94746
95118
|
}, data),
|
|
@@ -95900,6 +96272,72 @@ function terminateHtmlFlowBlocks(content) {
|
|
|
95900
96272
|
return restoreCodeBlocks(result.join('\n'), protectedCode);
|
|
95901
96273
|
}
|
|
95902
96274
|
|
|
96275
|
+
// EXTERNAL MODULE: external "@readme/variable"
|
|
96276
|
+
var variable_ = __webpack_require__(8167);
|
|
96277
|
+
var variable_default = /*#__PURE__*/__webpack_require__.n(variable_);
|
|
96278
|
+
;// ./processor/transform/mdxish/variables-code.ts
|
|
96279
|
+
|
|
96280
|
+
|
|
96281
|
+
// Single combined regex so that resolved values from one pattern are never re-scanned by the other.
|
|
96282
|
+
const COMBINED_VARIABLE_REGEX = new RegExp(`${variable_.VARIABLE_REGEXP}|${variable_.MDX_VARIABLE_REGEXP}`, 'giu');
|
|
96283
|
+
// Flatten variables into a single object for easy lookup
|
|
96284
|
+
function variables_code_flattenVariables(variables) {
|
|
96285
|
+
if (!variables)
|
|
96286
|
+
return {};
|
|
96287
|
+
return {
|
|
96288
|
+
...Object.fromEntries((variables.defaults || []).map(d => [d.name, d.default])),
|
|
96289
|
+
...variables.user,
|
|
96290
|
+
};
|
|
96291
|
+
}
|
|
96292
|
+
function resolveCodeVariables(value, resolvedVariables) {
|
|
96293
|
+
return value.replace(COMBINED_VARIABLE_REGEX, (match, legacyName, mdxEscapePrefix, mdxVarName, mdxEscapeSuffix) => {
|
|
96294
|
+
// Legacy variable: <<...>>
|
|
96295
|
+
if (legacyName !== undefined) {
|
|
96296
|
+
if (match.startsWith('\\<<') || match.endsWith('\\>>'))
|
|
96297
|
+
return match;
|
|
96298
|
+
const name = legacyName.trim();
|
|
96299
|
+
if (name.startsWith('glossary:'))
|
|
96300
|
+
return name.toUpperCase();
|
|
96301
|
+
return name in resolvedVariables ? resolvedVariables[name] : name.toUpperCase();
|
|
96302
|
+
}
|
|
96303
|
+
// MDX variable: {user.*}
|
|
96304
|
+
if (mdxEscapePrefix || mdxEscapeSuffix)
|
|
96305
|
+
return match;
|
|
96306
|
+
if (mdxVarName in resolvedVariables)
|
|
96307
|
+
return resolvedVariables[mdxVarName];
|
|
96308
|
+
const fullPath = match.slice(1, -1);
|
|
96309
|
+
return fullPath.toUpperCase();
|
|
96310
|
+
});
|
|
96311
|
+
}
|
|
96312
|
+
/**
|
|
96313
|
+
* A remark mdast plugin that resolves legacy variables <<...>> and MDX variables {user.*} inside code and inline code nodes
|
|
96314
|
+
* to their values. Uses regexes from the readme variable to search for variables in the code string.
|
|
96315
|
+
*
|
|
96316
|
+
* This is needed because variables in code blocks and inline cannot be tokenized, and also we need to maintain the code string
|
|
96317
|
+
* in the code nodes. This enables engine side variable resolution in codes which improves UX
|
|
96318
|
+
*/
|
|
96319
|
+
const variablesCodeResolver = ({ variables } = {}) => tree => {
|
|
96320
|
+
const resolvedVariables = variables_code_flattenVariables(variables);
|
|
96321
|
+
visit(tree, 'inlineCode', (node) => {
|
|
96322
|
+
if (!node.value)
|
|
96323
|
+
return;
|
|
96324
|
+
node.value = resolveCodeVariables(node.value, resolvedVariables);
|
|
96325
|
+
});
|
|
96326
|
+
visit(tree, 'code', (node) => {
|
|
96327
|
+
if (!node.value)
|
|
96328
|
+
return;
|
|
96329
|
+
const nextValue = resolveCodeVariables(node.value, resolvedVariables);
|
|
96330
|
+
node.value = nextValue;
|
|
96331
|
+
// Keep code-tabs/readme-components hProperties in sync with node.value
|
|
96332
|
+
// because renderers read `value` from hProperties.
|
|
96333
|
+
if (node.data?.hProperties && typeof node.data.hProperties === 'object') {
|
|
96334
|
+
node.data.hProperties.value = nextValue;
|
|
96335
|
+
}
|
|
96336
|
+
});
|
|
96337
|
+
return tree;
|
|
96338
|
+
};
|
|
96339
|
+
/* harmony default export */ const variables_code = (variablesCodeResolver);
|
|
96340
|
+
|
|
95903
96341
|
;// ./processor/transform/mdxish/variables-text.ts
|
|
95904
96342
|
|
|
95905
96343
|
|
|
@@ -95969,7 +96407,7 @@ const variablesTextTransformer = () => tree => {
|
|
|
95969
96407
|
/* harmony default export */ const variables_text = (variablesTextTransformer);
|
|
95970
96408
|
|
|
95971
96409
|
;// ./lib/mdast-util/magic-block/index.ts
|
|
95972
|
-
const
|
|
96410
|
+
const magic_block_contextMap = new WeakMap();
|
|
95973
96411
|
/**
|
|
95974
96412
|
* Find the magicBlock token in the token ancestry.
|
|
95975
96413
|
*/
|
|
@@ -95989,7 +96427,7 @@ function findMagicBlockToken() {
|
|
|
95989
96427
|
*/
|
|
95990
96428
|
function enterMagicBlock(token) {
|
|
95991
96429
|
// Initialize context for this magic block
|
|
95992
|
-
|
|
96430
|
+
magic_block_contextMap.set(token, { blockType: '', dataChunks: [] });
|
|
95993
96431
|
this.enter({
|
|
95994
96432
|
type: 'magicBlock',
|
|
95995
96433
|
blockType: '',
|
|
@@ -96004,7 +96442,7 @@ function exitMagicBlockType(token) {
|
|
|
96004
96442
|
const blockToken = findMagicBlockToken.call(this);
|
|
96005
96443
|
if (!blockToken)
|
|
96006
96444
|
return;
|
|
96007
|
-
const context =
|
|
96445
|
+
const context = magic_block_contextMap.get(blockToken);
|
|
96008
96446
|
if (context) {
|
|
96009
96447
|
context.blockType = this.sliceSerialize(token);
|
|
96010
96448
|
}
|
|
@@ -96016,7 +96454,7 @@ function exitMagicBlockData(token) {
|
|
|
96016
96454
|
const blockToken = findMagicBlockToken.call(this);
|
|
96017
96455
|
if (!blockToken)
|
|
96018
96456
|
return;
|
|
96019
|
-
const context =
|
|
96457
|
+
const context = magic_block_contextMap.get(blockToken);
|
|
96020
96458
|
if (context) {
|
|
96021
96459
|
context.dataChunks.push(this.sliceSerialize(token));
|
|
96022
96460
|
}
|
|
@@ -96028,7 +96466,7 @@ function exitMagicBlockLineEnding(token) {
|
|
|
96028
96466
|
const blockToken = findMagicBlockToken.call(this);
|
|
96029
96467
|
if (!blockToken)
|
|
96030
96468
|
return;
|
|
96031
|
-
const context =
|
|
96469
|
+
const context = magic_block_contextMap.get(blockToken);
|
|
96032
96470
|
if (context) {
|
|
96033
96471
|
context.dataChunks.push(this.sliceSerialize(token));
|
|
96034
96472
|
}
|
|
@@ -96046,7 +96484,7 @@ function exitMagicBlockMarkerEnd(token) {
|
|
|
96046
96484
|
// If this marker doesn't end with ']', it's a failed check and content belongs to data
|
|
96047
96485
|
// The successful end marker would be "[/block]"
|
|
96048
96486
|
if (!markerContent.endsWith(']') || markerContent !== '[/block]') {
|
|
96049
|
-
const context =
|
|
96487
|
+
const context = magic_block_contextMap.get(blockToken);
|
|
96050
96488
|
if (context) {
|
|
96051
96489
|
context.dataChunks.push(markerContent);
|
|
96052
96490
|
}
|
|
@@ -96056,7 +96494,7 @@ function exitMagicBlockMarkerEnd(token) {
|
|
|
96056
96494
|
* Exit handler: Finalize the magicBlock node with parsed JSON data.
|
|
96057
96495
|
*/
|
|
96058
96496
|
function exitMagicBlock(token) {
|
|
96059
|
-
const context =
|
|
96497
|
+
const context = magic_block_contextMap.get(token);
|
|
96060
96498
|
const node = this.stack[this.stack.length - 1];
|
|
96061
96499
|
if (context) {
|
|
96062
96500
|
const rawJson = context.dataChunks.join('');
|
|
@@ -96071,7 +96509,7 @@ function exitMagicBlock(token) {
|
|
|
96071
96509
|
node.data = {};
|
|
96072
96510
|
}
|
|
96073
96511
|
// Clean up context
|
|
96074
|
-
|
|
96512
|
+
magic_block_contextMap.delete(token);
|
|
96075
96513
|
}
|
|
96076
96514
|
this.exit(token);
|
|
96077
96515
|
}
|
|
@@ -96124,166 +96562,6 @@ function magicBlockToMarkdown() {
|
|
|
96124
96562
|
};
|
|
96125
96563
|
}
|
|
96126
96564
|
|
|
96127
|
-
;// ./node_modules/micromark-util-symbol/lib/codes.js
|
|
96128
|
-
/**
|
|
96129
|
-
* Character codes.
|
|
96130
|
-
*
|
|
96131
|
-
* This module is compiled away!
|
|
96132
|
-
*
|
|
96133
|
-
* micromark works based on character codes.
|
|
96134
|
-
* This module contains constants for the ASCII block and the replacement
|
|
96135
|
-
* character.
|
|
96136
|
-
* A couple of them are handled in a special way, such as the line endings
|
|
96137
|
-
* (CR, LF, and CR+LF, commonly known as end-of-line: EOLs), the tab (horizontal
|
|
96138
|
-
* tab) and its expansion based on what column it’s at (virtual space),
|
|
96139
|
-
* and the end-of-file (eof) character.
|
|
96140
|
-
* As values are preprocessed before handling them, the actual characters LF,
|
|
96141
|
-
* CR, HT, and NUL (which is present as the replacement character), are
|
|
96142
|
-
* guaranteed to not exist.
|
|
96143
|
-
*
|
|
96144
|
-
* Unicode basic latin block.
|
|
96145
|
-
*/
|
|
96146
|
-
const codes = /** @type {const} */ ({
|
|
96147
|
-
carriageReturn: -5,
|
|
96148
|
-
lineFeed: -4,
|
|
96149
|
-
carriageReturnLineFeed: -3,
|
|
96150
|
-
horizontalTab: -2,
|
|
96151
|
-
virtualSpace: -1,
|
|
96152
|
-
eof: null,
|
|
96153
|
-
nul: 0,
|
|
96154
|
-
soh: 1,
|
|
96155
|
-
stx: 2,
|
|
96156
|
-
etx: 3,
|
|
96157
|
-
eot: 4,
|
|
96158
|
-
enq: 5,
|
|
96159
|
-
ack: 6,
|
|
96160
|
-
bel: 7,
|
|
96161
|
-
bs: 8,
|
|
96162
|
-
ht: 9, // `\t`
|
|
96163
|
-
lf: 10, // `\n`
|
|
96164
|
-
vt: 11, // `\v`
|
|
96165
|
-
ff: 12, // `\f`
|
|
96166
|
-
cr: 13, // `\r`
|
|
96167
|
-
so: 14,
|
|
96168
|
-
si: 15,
|
|
96169
|
-
dle: 16,
|
|
96170
|
-
dc1: 17,
|
|
96171
|
-
dc2: 18,
|
|
96172
|
-
dc3: 19,
|
|
96173
|
-
dc4: 20,
|
|
96174
|
-
nak: 21,
|
|
96175
|
-
syn: 22,
|
|
96176
|
-
etb: 23,
|
|
96177
|
-
can: 24,
|
|
96178
|
-
em: 25,
|
|
96179
|
-
sub: 26,
|
|
96180
|
-
esc: 27,
|
|
96181
|
-
fs: 28,
|
|
96182
|
-
gs: 29,
|
|
96183
|
-
rs: 30,
|
|
96184
|
-
us: 31,
|
|
96185
|
-
space: 32,
|
|
96186
|
-
exclamationMark: 33, // `!`
|
|
96187
|
-
quotationMark: 34, // `"`
|
|
96188
|
-
numberSign: 35, // `#`
|
|
96189
|
-
dollarSign: 36, // `$`
|
|
96190
|
-
percentSign: 37, // `%`
|
|
96191
|
-
ampersand: 38, // `&`
|
|
96192
|
-
apostrophe: 39, // `'`
|
|
96193
|
-
leftParenthesis: 40, // `(`
|
|
96194
|
-
rightParenthesis: 41, // `)`
|
|
96195
|
-
asterisk: 42, // `*`
|
|
96196
|
-
plusSign: 43, // `+`
|
|
96197
|
-
comma: 44, // `,`
|
|
96198
|
-
dash: 45, // `-`
|
|
96199
|
-
dot: 46, // `.`
|
|
96200
|
-
slash: 47, // `/`
|
|
96201
|
-
digit0: 48, // `0`
|
|
96202
|
-
digit1: 49, // `1`
|
|
96203
|
-
digit2: 50, // `2`
|
|
96204
|
-
digit3: 51, // `3`
|
|
96205
|
-
digit4: 52, // `4`
|
|
96206
|
-
digit5: 53, // `5`
|
|
96207
|
-
digit6: 54, // `6`
|
|
96208
|
-
digit7: 55, // `7`
|
|
96209
|
-
digit8: 56, // `8`
|
|
96210
|
-
digit9: 57, // `9`
|
|
96211
|
-
colon: 58, // `:`
|
|
96212
|
-
semicolon: 59, // `;`
|
|
96213
|
-
lessThan: 60, // `<`
|
|
96214
|
-
equalsTo: 61, // `=`
|
|
96215
|
-
greaterThan: 62, // `>`
|
|
96216
|
-
questionMark: 63, // `?`
|
|
96217
|
-
atSign: 64, // `@`
|
|
96218
|
-
uppercaseA: 65, // `A`
|
|
96219
|
-
uppercaseB: 66, // `B`
|
|
96220
|
-
uppercaseC: 67, // `C`
|
|
96221
|
-
uppercaseD: 68, // `D`
|
|
96222
|
-
uppercaseE: 69, // `E`
|
|
96223
|
-
uppercaseF: 70, // `F`
|
|
96224
|
-
uppercaseG: 71, // `G`
|
|
96225
|
-
uppercaseH: 72, // `H`
|
|
96226
|
-
uppercaseI: 73, // `I`
|
|
96227
|
-
uppercaseJ: 74, // `J`
|
|
96228
|
-
uppercaseK: 75, // `K`
|
|
96229
|
-
uppercaseL: 76, // `L`
|
|
96230
|
-
uppercaseM: 77, // `M`
|
|
96231
|
-
uppercaseN: 78, // `N`
|
|
96232
|
-
uppercaseO: 79, // `O`
|
|
96233
|
-
uppercaseP: 80, // `P`
|
|
96234
|
-
uppercaseQ: 81, // `Q`
|
|
96235
|
-
uppercaseR: 82, // `R`
|
|
96236
|
-
uppercaseS: 83, // `S`
|
|
96237
|
-
uppercaseT: 84, // `T`
|
|
96238
|
-
uppercaseU: 85, // `U`
|
|
96239
|
-
uppercaseV: 86, // `V`
|
|
96240
|
-
uppercaseW: 87, // `W`
|
|
96241
|
-
uppercaseX: 88, // `X`
|
|
96242
|
-
uppercaseY: 89, // `Y`
|
|
96243
|
-
uppercaseZ: 90, // `Z`
|
|
96244
|
-
leftSquareBracket: 91, // `[`
|
|
96245
|
-
backslash: 92, // `\`
|
|
96246
|
-
rightSquareBracket: 93, // `]`
|
|
96247
|
-
caret: 94, // `^`
|
|
96248
|
-
underscore: 95, // `_`
|
|
96249
|
-
graveAccent: 96, // `` ` ``
|
|
96250
|
-
lowercaseA: 97, // `a`
|
|
96251
|
-
lowercaseB: 98, // `b`
|
|
96252
|
-
lowercaseC: 99, // `c`
|
|
96253
|
-
lowercaseD: 100, // `d`
|
|
96254
|
-
lowercaseE: 101, // `e`
|
|
96255
|
-
lowercaseF: 102, // `f`
|
|
96256
|
-
lowercaseG: 103, // `g`
|
|
96257
|
-
lowercaseH: 104, // `h`
|
|
96258
|
-
lowercaseI: 105, // `i`
|
|
96259
|
-
lowercaseJ: 106, // `j`
|
|
96260
|
-
lowercaseK: 107, // `k`
|
|
96261
|
-
lowercaseL: 108, // `l`
|
|
96262
|
-
lowercaseM: 109, // `m`
|
|
96263
|
-
lowercaseN: 110, // `n`
|
|
96264
|
-
lowercaseO: 111, // `o`
|
|
96265
|
-
lowercaseP: 112, // `p`
|
|
96266
|
-
lowercaseQ: 113, // `q`
|
|
96267
|
-
lowercaseR: 114, // `r`
|
|
96268
|
-
lowercaseS: 115, // `s`
|
|
96269
|
-
lowercaseT: 116, // `t`
|
|
96270
|
-
lowercaseU: 117, // `u`
|
|
96271
|
-
lowercaseV: 118, // `v`
|
|
96272
|
-
lowercaseW: 119, // `w`
|
|
96273
|
-
lowercaseX: 120, // `x`
|
|
96274
|
-
lowercaseY: 121, // `y`
|
|
96275
|
-
lowercaseZ: 122, // `z`
|
|
96276
|
-
leftCurlyBrace: 123, // `{`
|
|
96277
|
-
verticalBar: 124, // `|`
|
|
96278
|
-
rightCurlyBrace: 125, // `}`
|
|
96279
|
-
tilde: 126, // `~`
|
|
96280
|
-
del: 127,
|
|
96281
|
-
// Unicode Specials block.
|
|
96282
|
-
byteOrderMarker: 65_279,
|
|
96283
|
-
// Unicode Specials block.
|
|
96284
|
-
replacementCharacter: 65_533 // `�`
|
|
96285
|
-
})
|
|
96286
|
-
|
|
96287
96565
|
;// ./lib/micromark/magic-block/syntax.ts
|
|
96288
96566
|
|
|
96289
96567
|
|
|
@@ -97203,6 +97481,9 @@ function loadComponents() {
|
|
|
97203
97481
|
|
|
97204
97482
|
|
|
97205
97483
|
|
|
97484
|
+
|
|
97485
|
+
|
|
97486
|
+
|
|
97206
97487
|
|
|
97207
97488
|
|
|
97208
97489
|
|
|
@@ -97250,8 +97531,10 @@ function mdxishAstProcessor(mdContent, opts = {}) {
|
|
|
97250
97531
|
text: mdxExprExt.text,
|
|
97251
97532
|
};
|
|
97252
97533
|
const processor = unified()
|
|
97253
|
-
.data('micromarkExtensions', safeMode ? [magicBlock()] : [magicBlock(), mdxExprTextOnly])
|
|
97254
|
-
.data('fromMarkdownExtensions', safeMode
|
|
97534
|
+
.data('micromarkExtensions', safeMode ? [magicBlock(), legacyVariable()] : [magicBlock(), mdxExprTextOnly, legacyVariable()])
|
|
97535
|
+
.data('fromMarkdownExtensions', safeMode
|
|
97536
|
+
? [magicBlockFromMarkdown(), legacyVariableFromMarkdown()]
|
|
97537
|
+
: [magicBlockFromMarkdown(), mdxExpressionFromMarkdown(), legacyVariableFromMarkdown()])
|
|
97255
97538
|
.use(remarkParse)
|
|
97256
97539
|
.use(remarkFrontmatter)
|
|
97257
97540
|
.use(normalize_malformed_md_syntax)
|
|
@@ -97298,7 +97581,7 @@ function mdxishMdastToMd(mdast) {
|
|
|
97298
97581
|
* @see {@link https://github.com/readmeio/rmdx/blob/main/docs/mdxish-flow.md}
|
|
97299
97582
|
*/
|
|
97300
97583
|
function mdxish(mdContent, opts = {}) {
|
|
97301
|
-
const { components: userComponents = {} } = opts;
|
|
97584
|
+
const { components: userComponents = {}, variables } = opts;
|
|
97302
97585
|
const components = {
|
|
97303
97586
|
...loadComponents(),
|
|
97304
97587
|
...userComponents,
|
|
@@ -97306,12 +97589,13 @@ function mdxish(mdContent, opts = {}) {
|
|
|
97306
97589
|
const { processor, parserReadyContent } = mdxishAstProcessor(mdContent, opts);
|
|
97307
97590
|
processor
|
|
97308
97591
|
.use(remarkBreaks)
|
|
97592
|
+
.use(variables_code, { variables }) // Resolve <<...>> and {user.*} inside code and inline code nodes
|
|
97309
97593
|
.use(remarkRehype, { allowDangerousHtml: true, handlers: mdxComponentHandlers })
|
|
97310
97594
|
.use(preserveBooleanProperties) // RehypeRaw converts boolean properties to empty strings
|
|
97311
97595
|
.use(rehypeRaw, { passThrough: ['html-block'] })
|
|
97312
97596
|
.use(restoreBooleanProperties)
|
|
97313
97597
|
.use(mdxish_mermaid) // Add mermaid-render className to pre wrappers
|
|
97314
|
-
.use(
|
|
97598
|
+
.use(heading_slugs)
|
|
97315
97599
|
.use(rehypeMdxishComponents, {
|
|
97316
97600
|
components,
|
|
97317
97601
|
processMarkdown: (markdown) => mdxish(markdown, opts),
|
|
@@ -97451,9 +97735,6 @@ const migrate = (doc, opts) => {
|
|
|
97451
97735
|
};
|
|
97452
97736
|
/* harmony default export */ const lib_migrate = (migrate);
|
|
97453
97737
|
|
|
97454
|
-
// EXTERNAL MODULE: external "@readme/variable"
|
|
97455
|
-
var variable_ = __webpack_require__(8167);
|
|
97456
|
-
var variable_default = /*#__PURE__*/__webpack_require__.n(variable_);
|
|
97457
97738
|
// EXTERNAL MODULE: ./node_modules/rehype-react/index.js
|
|
97458
97739
|
var rehype_react = __webpack_require__(26);
|
|
97459
97740
|
var rehype_react_default = /*#__PURE__*/__webpack_require__.n(rehype_react);
|