@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.node.js
CHANGED
|
@@ -25091,12 +25091,12 @@ const parseOptions = (userOpts = {}) => {
|
|
|
25091
25091
|
return opts;
|
|
25092
25092
|
};
|
|
25093
25093
|
|
|
25094
|
-
;// ./node_modules/
|
|
25094
|
+
;// ./node_modules/github-slugger/regex.js
|
|
25095
25095
|
// This module is generated by `script/`.
|
|
25096
25096
|
/* eslint-disable no-control-regex, no-misleading-character-class, no-useless-escape */
|
|
25097
25097
|
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\u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DCE\u0DD5\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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F\uDF89\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
|
|
25098
25098
|
|
|
25099
|
-
;// ./node_modules/
|
|
25099
|
+
;// ./node_modules/github-slugger/index.js
|
|
25100
25100
|
|
|
25101
25101
|
|
|
25102
25102
|
const own = Object.hasOwnProperty
|
|
@@ -73190,6 +73190,8 @@ function plain_one(node, opts) {
|
|
|
73190
73190
|
case 'variable':
|
|
73191
73191
|
case 'Variable': {
|
|
73192
73192
|
const key = node.properties.name.toString();
|
|
73193
|
+
if (opts.preserveVariableSyntax)
|
|
73194
|
+
return `{user.${key}}`;
|
|
73193
73195
|
const val = 'variables' in opts && opts.variables[key];
|
|
73194
73196
|
return val || key;
|
|
73195
73197
|
}
|
|
@@ -73213,6 +73215,8 @@ function plain_one(node, opts) {
|
|
|
73213
73215
|
if (node.type === 'mdxTextExpression') {
|
|
73214
73216
|
const key = extractMdxVariableKey(node);
|
|
73215
73217
|
if (key) {
|
|
73218
|
+
if (opts.preserveVariableSyntax)
|
|
73219
|
+
return `{user.${key}}`;
|
|
73216
73220
|
return ('variables' in opts && opts.variables[key]) || key;
|
|
73217
73221
|
}
|
|
73218
73222
|
}
|
|
@@ -91037,9 +91041,320 @@ const mdxToHast = () => tree => {
|
|
|
91037
91041
|
};
|
|
91038
91042
|
/* harmony default export */ const mdx_to_hast = (mdxToHast);
|
|
91039
91043
|
|
|
91044
|
+
;// ./lib/mdast-util/legacy-variable/index.ts
|
|
91045
|
+
|
|
91046
|
+
const contextMap = new WeakMap();
|
|
91047
|
+
function findlegacyVariableToken() {
|
|
91048
|
+
// tokenStack is micromark's current open token ancestry; find the nearest legacyVariable token.
|
|
91049
|
+
const events = this.tokenStack;
|
|
91050
|
+
for (let i = events.length - 1; i >= 0; i -= 1) {
|
|
91051
|
+
const token = events[i][0];
|
|
91052
|
+
if (token.type === 'legacyVariable')
|
|
91053
|
+
return token;
|
|
91054
|
+
}
|
|
91055
|
+
return undefined;
|
|
91056
|
+
}
|
|
91057
|
+
function enterlegacyVariable(token) {
|
|
91058
|
+
contextMap.set(token, { value: '' });
|
|
91059
|
+
}
|
|
91060
|
+
function exitlegacyVariableValue(token) {
|
|
91061
|
+
const variableToken = findlegacyVariableToken.call(this);
|
|
91062
|
+
if (!variableToken)
|
|
91063
|
+
return;
|
|
91064
|
+
const ctx = contextMap.get(variableToken);
|
|
91065
|
+
// Build up the variable characters
|
|
91066
|
+
if (ctx)
|
|
91067
|
+
ctx.value += this.sliceSerialize(token);
|
|
91068
|
+
}
|
|
91069
|
+
function exitlegacyVariable(token) {
|
|
91070
|
+
const ctx = contextMap.get(token);
|
|
91071
|
+
const serialized = this.sliceSerialize(token);
|
|
91072
|
+
const variableName = serialized.startsWith('<<') && serialized.endsWith('>>')
|
|
91073
|
+
? serialized.slice(2, -2)
|
|
91074
|
+
: ctx?.value ?? '';
|
|
91075
|
+
const nodePosition = {
|
|
91076
|
+
start: {
|
|
91077
|
+
offset: token.start.offset,
|
|
91078
|
+
line: token.start.line,
|
|
91079
|
+
column: token.start.column,
|
|
91080
|
+
},
|
|
91081
|
+
end: {
|
|
91082
|
+
offset: token.end.offset,
|
|
91083
|
+
line: token.end.line,
|
|
91084
|
+
column: token.end.column,
|
|
91085
|
+
},
|
|
91086
|
+
};
|
|
91087
|
+
if (variableName.startsWith('glossary:')) {
|
|
91088
|
+
const term = variableName.slice('glossary:'.length).trim();
|
|
91089
|
+
this.enter({
|
|
91090
|
+
type: NodeTypes.glossary,
|
|
91091
|
+
data: {
|
|
91092
|
+
hName: 'Glossary',
|
|
91093
|
+
hProperties: { term },
|
|
91094
|
+
},
|
|
91095
|
+
children: [{ type: 'text', value: term }],
|
|
91096
|
+
position: nodePosition,
|
|
91097
|
+
}, token);
|
|
91098
|
+
this.exit(token);
|
|
91099
|
+
contextMap.delete(token);
|
|
91100
|
+
return;
|
|
91101
|
+
}
|
|
91102
|
+
this.enter({
|
|
91103
|
+
type: NodeTypes.variable,
|
|
91104
|
+
data: {
|
|
91105
|
+
hName: 'Variable',
|
|
91106
|
+
hProperties: { name: variableName.trim(), isLegacy: true },
|
|
91107
|
+
},
|
|
91108
|
+
value: `<<${variableName}>>`,
|
|
91109
|
+
}, token);
|
|
91110
|
+
this.exit(token);
|
|
91111
|
+
contextMap.delete(token);
|
|
91112
|
+
}
|
|
91113
|
+
function legacyVariableFromMarkdown() {
|
|
91114
|
+
return {
|
|
91115
|
+
enter: {
|
|
91116
|
+
legacyVariable: enterlegacyVariable,
|
|
91117
|
+
},
|
|
91118
|
+
exit: {
|
|
91119
|
+
legacyVariableValue: exitlegacyVariableValue,
|
|
91120
|
+
legacyVariable: exitlegacyVariable,
|
|
91121
|
+
},
|
|
91122
|
+
};
|
|
91123
|
+
}
|
|
91124
|
+
|
|
91125
|
+
;// ./node_modules/micromark-util-symbol/lib/codes.js
|
|
91126
|
+
/**
|
|
91127
|
+
* Character codes.
|
|
91128
|
+
*
|
|
91129
|
+
* This module is compiled away!
|
|
91130
|
+
*
|
|
91131
|
+
* micromark works based on character codes.
|
|
91132
|
+
* This module contains constants for the ASCII block and the replacement
|
|
91133
|
+
* character.
|
|
91134
|
+
* A couple of them are handled in a special way, such as the line endings
|
|
91135
|
+
* (CR, LF, and CR+LF, commonly known as end-of-line: EOLs), the tab (horizontal
|
|
91136
|
+
* tab) and its expansion based on what column it’s at (virtual space),
|
|
91137
|
+
* and the end-of-file (eof) character.
|
|
91138
|
+
* As values are preprocessed before handling them, the actual characters LF,
|
|
91139
|
+
* CR, HT, and NUL (which is present as the replacement character), are
|
|
91140
|
+
* guaranteed to not exist.
|
|
91141
|
+
*
|
|
91142
|
+
* Unicode basic latin block.
|
|
91143
|
+
*/
|
|
91144
|
+
const codes = /** @type {const} */ ({
|
|
91145
|
+
carriageReturn: -5,
|
|
91146
|
+
lineFeed: -4,
|
|
91147
|
+
carriageReturnLineFeed: -3,
|
|
91148
|
+
horizontalTab: -2,
|
|
91149
|
+
virtualSpace: -1,
|
|
91150
|
+
eof: null,
|
|
91151
|
+
nul: 0,
|
|
91152
|
+
soh: 1,
|
|
91153
|
+
stx: 2,
|
|
91154
|
+
etx: 3,
|
|
91155
|
+
eot: 4,
|
|
91156
|
+
enq: 5,
|
|
91157
|
+
ack: 6,
|
|
91158
|
+
bel: 7,
|
|
91159
|
+
bs: 8,
|
|
91160
|
+
ht: 9, // `\t`
|
|
91161
|
+
lf: 10, // `\n`
|
|
91162
|
+
vt: 11, // `\v`
|
|
91163
|
+
ff: 12, // `\f`
|
|
91164
|
+
cr: 13, // `\r`
|
|
91165
|
+
so: 14,
|
|
91166
|
+
si: 15,
|
|
91167
|
+
dle: 16,
|
|
91168
|
+
dc1: 17,
|
|
91169
|
+
dc2: 18,
|
|
91170
|
+
dc3: 19,
|
|
91171
|
+
dc4: 20,
|
|
91172
|
+
nak: 21,
|
|
91173
|
+
syn: 22,
|
|
91174
|
+
etb: 23,
|
|
91175
|
+
can: 24,
|
|
91176
|
+
em: 25,
|
|
91177
|
+
sub: 26,
|
|
91178
|
+
esc: 27,
|
|
91179
|
+
fs: 28,
|
|
91180
|
+
gs: 29,
|
|
91181
|
+
rs: 30,
|
|
91182
|
+
us: 31,
|
|
91183
|
+
space: 32,
|
|
91184
|
+
exclamationMark: 33, // `!`
|
|
91185
|
+
quotationMark: 34, // `"`
|
|
91186
|
+
numberSign: 35, // `#`
|
|
91187
|
+
dollarSign: 36, // `$`
|
|
91188
|
+
percentSign: 37, // `%`
|
|
91189
|
+
ampersand: 38, // `&`
|
|
91190
|
+
apostrophe: 39, // `'`
|
|
91191
|
+
leftParenthesis: 40, // `(`
|
|
91192
|
+
rightParenthesis: 41, // `)`
|
|
91193
|
+
asterisk: 42, // `*`
|
|
91194
|
+
plusSign: 43, // `+`
|
|
91195
|
+
comma: 44, // `,`
|
|
91196
|
+
dash: 45, // `-`
|
|
91197
|
+
dot: 46, // `.`
|
|
91198
|
+
slash: 47, // `/`
|
|
91199
|
+
digit0: 48, // `0`
|
|
91200
|
+
digit1: 49, // `1`
|
|
91201
|
+
digit2: 50, // `2`
|
|
91202
|
+
digit3: 51, // `3`
|
|
91203
|
+
digit4: 52, // `4`
|
|
91204
|
+
digit5: 53, // `5`
|
|
91205
|
+
digit6: 54, // `6`
|
|
91206
|
+
digit7: 55, // `7`
|
|
91207
|
+
digit8: 56, // `8`
|
|
91208
|
+
digit9: 57, // `9`
|
|
91209
|
+
colon: 58, // `:`
|
|
91210
|
+
semicolon: 59, // `;`
|
|
91211
|
+
lessThan: 60, // `<`
|
|
91212
|
+
equalsTo: 61, // `=`
|
|
91213
|
+
greaterThan: 62, // `>`
|
|
91214
|
+
questionMark: 63, // `?`
|
|
91215
|
+
atSign: 64, // `@`
|
|
91216
|
+
uppercaseA: 65, // `A`
|
|
91217
|
+
uppercaseB: 66, // `B`
|
|
91218
|
+
uppercaseC: 67, // `C`
|
|
91219
|
+
uppercaseD: 68, // `D`
|
|
91220
|
+
uppercaseE: 69, // `E`
|
|
91221
|
+
uppercaseF: 70, // `F`
|
|
91222
|
+
uppercaseG: 71, // `G`
|
|
91223
|
+
uppercaseH: 72, // `H`
|
|
91224
|
+
uppercaseI: 73, // `I`
|
|
91225
|
+
uppercaseJ: 74, // `J`
|
|
91226
|
+
uppercaseK: 75, // `K`
|
|
91227
|
+
uppercaseL: 76, // `L`
|
|
91228
|
+
uppercaseM: 77, // `M`
|
|
91229
|
+
uppercaseN: 78, // `N`
|
|
91230
|
+
uppercaseO: 79, // `O`
|
|
91231
|
+
uppercaseP: 80, // `P`
|
|
91232
|
+
uppercaseQ: 81, // `Q`
|
|
91233
|
+
uppercaseR: 82, // `R`
|
|
91234
|
+
uppercaseS: 83, // `S`
|
|
91235
|
+
uppercaseT: 84, // `T`
|
|
91236
|
+
uppercaseU: 85, // `U`
|
|
91237
|
+
uppercaseV: 86, // `V`
|
|
91238
|
+
uppercaseW: 87, // `W`
|
|
91239
|
+
uppercaseX: 88, // `X`
|
|
91240
|
+
uppercaseY: 89, // `Y`
|
|
91241
|
+
uppercaseZ: 90, // `Z`
|
|
91242
|
+
leftSquareBracket: 91, // `[`
|
|
91243
|
+
backslash: 92, // `\`
|
|
91244
|
+
rightSquareBracket: 93, // `]`
|
|
91245
|
+
caret: 94, // `^`
|
|
91246
|
+
underscore: 95, // `_`
|
|
91247
|
+
graveAccent: 96, // `` ` ``
|
|
91248
|
+
lowercaseA: 97, // `a`
|
|
91249
|
+
lowercaseB: 98, // `b`
|
|
91250
|
+
lowercaseC: 99, // `c`
|
|
91251
|
+
lowercaseD: 100, // `d`
|
|
91252
|
+
lowercaseE: 101, // `e`
|
|
91253
|
+
lowercaseF: 102, // `f`
|
|
91254
|
+
lowercaseG: 103, // `g`
|
|
91255
|
+
lowercaseH: 104, // `h`
|
|
91256
|
+
lowercaseI: 105, // `i`
|
|
91257
|
+
lowercaseJ: 106, // `j`
|
|
91258
|
+
lowercaseK: 107, // `k`
|
|
91259
|
+
lowercaseL: 108, // `l`
|
|
91260
|
+
lowercaseM: 109, // `m`
|
|
91261
|
+
lowercaseN: 110, // `n`
|
|
91262
|
+
lowercaseO: 111, // `o`
|
|
91263
|
+
lowercaseP: 112, // `p`
|
|
91264
|
+
lowercaseQ: 113, // `q`
|
|
91265
|
+
lowercaseR: 114, // `r`
|
|
91266
|
+
lowercaseS: 115, // `s`
|
|
91267
|
+
lowercaseT: 116, // `t`
|
|
91268
|
+
lowercaseU: 117, // `u`
|
|
91269
|
+
lowercaseV: 118, // `v`
|
|
91270
|
+
lowercaseW: 119, // `w`
|
|
91271
|
+
lowercaseX: 120, // `x`
|
|
91272
|
+
lowercaseY: 121, // `y`
|
|
91273
|
+
lowercaseZ: 122, // `z`
|
|
91274
|
+
leftCurlyBrace: 123, // `{`
|
|
91275
|
+
verticalBar: 124, // `|`
|
|
91276
|
+
rightCurlyBrace: 125, // `}`
|
|
91277
|
+
tilde: 126, // `~`
|
|
91278
|
+
del: 127,
|
|
91279
|
+
// Unicode Specials block.
|
|
91280
|
+
byteOrderMarker: 65_279,
|
|
91281
|
+
// Unicode Specials block.
|
|
91282
|
+
replacementCharacter: 65_533 // `�`
|
|
91283
|
+
})
|
|
91284
|
+
|
|
91285
|
+
;// ./lib/micromark/legacy-variable/syntax.ts
|
|
91286
|
+
|
|
91287
|
+
|
|
91288
|
+
function isAllowedValueChar(code) {
|
|
91289
|
+
return (code !== null &&
|
|
91290
|
+
code !== codes.lessThan &&
|
|
91291
|
+
code !== codes.greaterThan &&
|
|
91292
|
+
!markdownLineEnding(code));
|
|
91293
|
+
}
|
|
91294
|
+
const legacyVariableConstruct = {
|
|
91295
|
+
name: 'legacyVariable',
|
|
91296
|
+
tokenize,
|
|
91297
|
+
};
|
|
91298
|
+
function tokenize(effects, ok, nok) {
|
|
91299
|
+
let hasValue = false;
|
|
91300
|
+
const start = (code) => {
|
|
91301
|
+
if (code !== codes.lessThan)
|
|
91302
|
+
return nok(code);
|
|
91303
|
+
effects.enter('legacyVariable');
|
|
91304
|
+
effects.enter('legacyVariableMarkerStart');
|
|
91305
|
+
effects.consume(code); // <
|
|
91306
|
+
return open2;
|
|
91307
|
+
};
|
|
91308
|
+
const open2 = (code) => {
|
|
91309
|
+
if (code !== codes.lessThan)
|
|
91310
|
+
return nok(code);
|
|
91311
|
+
effects.consume(code); // <<
|
|
91312
|
+
effects.exit('legacyVariableMarkerStart');
|
|
91313
|
+
effects.enter('legacyVariableValue');
|
|
91314
|
+
return value;
|
|
91315
|
+
};
|
|
91316
|
+
const value = (code) => {
|
|
91317
|
+
if (code === codes.greaterThan) {
|
|
91318
|
+
if (!hasValue)
|
|
91319
|
+
return nok(code);
|
|
91320
|
+
effects.exit('legacyVariableValue');
|
|
91321
|
+
effects.enter('legacyVariableMarkerEnd');
|
|
91322
|
+
effects.consume(code); // >
|
|
91323
|
+
return close2;
|
|
91324
|
+
}
|
|
91325
|
+
if (!isAllowedValueChar(code))
|
|
91326
|
+
return nok(code);
|
|
91327
|
+
hasValue = true;
|
|
91328
|
+
effects.consume(code);
|
|
91329
|
+
return value;
|
|
91330
|
+
};
|
|
91331
|
+
const close2 = (code) => {
|
|
91332
|
+
if (code !== codes.greaterThan)
|
|
91333
|
+
return nok(code);
|
|
91334
|
+
effects.consume(code); // >>
|
|
91335
|
+
effects.exit('legacyVariableMarkerEnd');
|
|
91336
|
+
effects.exit('legacyVariable');
|
|
91337
|
+
return ok;
|
|
91338
|
+
};
|
|
91339
|
+
return start;
|
|
91340
|
+
}
|
|
91341
|
+
function legacyVariable() {
|
|
91342
|
+
return {
|
|
91343
|
+
text: { [codes.lessThan]: legacyVariableConstruct },
|
|
91344
|
+
};
|
|
91345
|
+
}
|
|
91346
|
+
|
|
91347
|
+
;// ./lib/micromark/legacy-variable/index.ts
|
|
91348
|
+
/**
|
|
91349
|
+
* Micromark extension for <<variable>> / <<glossary:term>> inline syntax.
|
|
91350
|
+
*/
|
|
91351
|
+
|
|
91352
|
+
|
|
91040
91353
|
;// ./processor/transform/mdxish/mdxish-component-blocks.ts
|
|
91041
91354
|
|
|
91042
91355
|
|
|
91356
|
+
|
|
91357
|
+
|
|
91043
91358
|
const pascalCaseTagPattern = /^<([A-Z][A-Za-z0-9_]*)([^>]*?)(\/?)>([\s\S]*)?$/;
|
|
91044
91359
|
const tagAttributePattern = /([a-zA-Z_:][-a-zA-Z0-9_:.]*)(?:\s*=\s*("[^"]*"|'[^']*'|[^\s"'>]+))?/g;
|
|
91045
91360
|
/**
|
|
@@ -91056,7 +91371,10 @@ const MAX_LOOKAHEAD = 30;
|
|
|
91056
91371
|
* Glossary and Anchor are inline components.
|
|
91057
91372
|
*/
|
|
91058
91373
|
const EXCLUDED_TAGS = new Set(['HTMLBlock', 'Table', 'Glossary', 'Anchor']);
|
|
91059
|
-
const inlineMdProcessor = unified()
|
|
91374
|
+
const inlineMdProcessor = unified()
|
|
91375
|
+
.data('micromarkExtensions', [legacyVariable()])
|
|
91376
|
+
.data('fromMarkdownExtensions', [legacyVariableFromMarkdown()])
|
|
91377
|
+
.use(remarkParse);
|
|
91060
91378
|
const isClosingTag = (value, tag) => value.trim() === `</${tag}>`;
|
|
91061
91379
|
/**
|
|
91062
91380
|
* Parse markdown content into mdast children nodes.
|
|
@@ -92163,6 +92481,7 @@ const variables = ({ asMdx } = { asMdx: true }) => tree => {
|
|
|
92163
92481
|
const name = expression.expression.property.type === 'Identifier'
|
|
92164
92482
|
? expression.expression.property.name
|
|
92165
92483
|
: expression.expression.property.value;
|
|
92484
|
+
const position = 'position' in node ? node.position : undefined;
|
|
92166
92485
|
const variable = asMdx
|
|
92167
92486
|
? {
|
|
92168
92487
|
type: 'mdxJsxTextElement',
|
|
@@ -92175,7 +92494,7 @@ const variables = ({ asMdx } = { asMdx: true }) => tree => {
|
|
|
92175
92494
|
},
|
|
92176
92495
|
],
|
|
92177
92496
|
children: [],
|
|
92178
|
-
position
|
|
92497
|
+
position,
|
|
92179
92498
|
}
|
|
92180
92499
|
: {
|
|
92181
92500
|
type: NodeTypes.variable,
|
|
@@ -92186,7 +92505,7 @@ const variables = ({ asMdx } = { asMdx: true }) => tree => {
|
|
|
92186
92505
|
},
|
|
92187
92506
|
},
|
|
92188
92507
|
value: `{${node.value}}`,
|
|
92189
|
-
position
|
|
92508
|
+
position,
|
|
92190
92509
|
};
|
|
92191
92510
|
parent.children.splice(index, 1, variable);
|
|
92192
92511
|
});
|
|
@@ -114230,7 +114549,7 @@ const evaluateExpressions = ({ context = {} } = {}) => tree => {
|
|
|
114230
114549
|
parent.children.splice(index, 1, {
|
|
114231
114550
|
type: 'text',
|
|
114232
114551
|
value: textValue,
|
|
114233
|
-
position:
|
|
114552
|
+
position: expressionNode.position,
|
|
114234
114553
|
});
|
|
114235
114554
|
}
|
|
114236
114555
|
catch (_error) {
|
|
@@ -114241,7 +114560,7 @@ const evaluateExpressions = ({ context = {} } = {}) => tree => {
|
|
|
114241
114560
|
parent.children.splice(index, 1, {
|
|
114242
114561
|
type: 'text',
|
|
114243
114562
|
value: `{${processed}}`,
|
|
114244
|
-
position:
|
|
114563
|
+
position: expressionNode.position,
|
|
114245
114564
|
});
|
|
114246
114565
|
}
|
|
114247
114566
|
});
|
|
@@ -114249,6 +114568,43 @@ const evaluateExpressions = ({ context = {} } = {}) => tree => {
|
|
|
114249
114568
|
};
|
|
114250
114569
|
/* harmony default export */ const evaluate_expressions = (evaluateExpressions);
|
|
114251
114570
|
|
|
114571
|
+
;// ./processor/transform/mdxish/heading-slugs.ts
|
|
114572
|
+
|
|
114573
|
+
|
|
114574
|
+
function isHeading(node) {
|
|
114575
|
+
return /^h[1-6]$/.test(node.tagName);
|
|
114576
|
+
}
|
|
114577
|
+
function textContent(node) {
|
|
114578
|
+
if (node.type === 'text')
|
|
114579
|
+
return node.value;
|
|
114580
|
+
// Process variable nodes by using their variable name for the id generation
|
|
114581
|
+
if (node.type === 'element' && node.tagName === 'variable' && node.properties?.name) {
|
|
114582
|
+
if (node.properties.isLegacy) {
|
|
114583
|
+
return node.properties.name;
|
|
114584
|
+
}
|
|
114585
|
+
return `user.${node.properties.name}`;
|
|
114586
|
+
}
|
|
114587
|
+
if ('children' in node)
|
|
114588
|
+
return node.children.map(textContent).join('');
|
|
114589
|
+
return '';
|
|
114590
|
+
}
|
|
114591
|
+
/**
|
|
114592
|
+
* Rehype plugin that constructs ids for headings
|
|
114593
|
+
* Id's are used to construct slug anchor links & Table of Contents during rendering
|
|
114594
|
+
* Use the text / nodes that make up the heading to generate the id
|
|
114595
|
+
*/
|
|
114596
|
+
const generateSlugForHeadings = () => (tree) => {
|
|
114597
|
+
const slugger = new BananaSlug();
|
|
114598
|
+
visit(tree, 'element', (node) => {
|
|
114599
|
+
if (isHeading(node) && !node.properties.id) {
|
|
114600
|
+
const text = node.children.map(textContent).join('');
|
|
114601
|
+
node.properties.id = slugger.slug(text);
|
|
114602
|
+
}
|
|
114603
|
+
});
|
|
114604
|
+
return tree;
|
|
114605
|
+
};
|
|
114606
|
+
/* harmony default export */ const heading_slugs = (generateSlugForHeadings);
|
|
114607
|
+
|
|
114252
114608
|
;// ./node_modules/rehype-parse/lib/index.js
|
|
114253
114609
|
/**
|
|
114254
114610
|
* @import {Root} from 'hast'
|
|
@@ -114730,6 +115086,8 @@ const EMPTY_CODE_PLACEHOLDER = {
|
|
|
114730
115086
|
|
|
114731
115087
|
|
|
114732
115088
|
|
|
115089
|
+
|
|
115090
|
+
|
|
114733
115091
|
/**
|
|
114734
115092
|
* Wraps a node in a "pinned" container if sidebar: true is set.
|
|
114735
115093
|
*/
|
|
@@ -114768,9 +115126,17 @@ const preprocessBody = (text) => {
|
|
|
114768
115126
|
return ensureLeadingBreaks(text);
|
|
114769
115127
|
};
|
|
114770
115128
|
/** Markdown parser */
|
|
114771
|
-
const contentParser = unified()
|
|
115129
|
+
const contentParser = unified()
|
|
115130
|
+
.data('micromarkExtensions', [legacyVariable()])
|
|
115131
|
+
.data('fromMarkdownExtensions', [legacyVariableFromMarkdown()])
|
|
115132
|
+
.use(remarkParse)
|
|
115133
|
+
.use(remarkBreaks)
|
|
115134
|
+
.use(remarkGfm)
|
|
115135
|
+
.use(normalize_malformed_md_syntax);
|
|
114772
115136
|
/** Markdown to HTML processor (mdast → hast → HTML string) */
|
|
114773
115137
|
const markdownToHtml = unified()
|
|
115138
|
+
.data('micromarkExtensions', [legacyVariable()])
|
|
115139
|
+
.data('fromMarkdownExtensions', [legacyVariableFromMarkdown()])
|
|
114774
115140
|
.use(remarkParse)
|
|
114775
115141
|
.use(remarkGfm)
|
|
114776
115142
|
.use(normalize_malformed_md_syntax)
|
|
@@ -114883,7 +115249,13 @@ const parseTableCell = (text) => {
|
|
|
114883
115249
|
};
|
|
114884
115250
|
const parseBlock = (text) => {
|
|
114885
115251
|
if (!text.trim())
|
|
114886
|
-
return
|
|
115252
|
+
return textToBlock('');
|
|
115253
|
+
const tree = contentParser.runSync(contentParser.parse(text));
|
|
115254
|
+
return tree.children;
|
|
115255
|
+
};
|
|
115256
|
+
const parseInline = (text) => {
|
|
115257
|
+
if (!text.trim())
|
|
115258
|
+
return textToInline(text);
|
|
114887
115259
|
const tree = contentParser.runSync(contentParser.parse(text));
|
|
114888
115260
|
return tree.children;
|
|
114889
115261
|
};
|
|
@@ -114944,7 +115316,7 @@ function transformMagicBlock(blockType, data, rawValue, options = {}) {
|
|
|
114944
115316
|
const depth = headerJson.level || (compatibilityMode ? 1 : 2);
|
|
114945
115317
|
return [
|
|
114946
115318
|
wrapPinnedBlocks({
|
|
114947
|
-
children: 'title' in headerJson ?
|
|
115319
|
+
children: 'title' in headerJson ? parseInline(headerJson.title || '') : [],
|
|
114948
115320
|
depth,
|
|
114949
115321
|
type: 'heading',
|
|
114950
115322
|
}, data),
|
|
@@ -116104,6 +116476,72 @@ function terminateHtmlFlowBlocks(content) {
|
|
|
116104
116476
|
return restoreCodeBlocks(result.join('\n'), protectedCode);
|
|
116105
116477
|
}
|
|
116106
116478
|
|
|
116479
|
+
// EXTERNAL MODULE: ./node_modules/@readme/variable/dist/index.js
|
|
116480
|
+
var variable_dist = __webpack_require__(4355);
|
|
116481
|
+
var variable_dist_default = /*#__PURE__*/__webpack_require__.n(variable_dist);
|
|
116482
|
+
;// ./processor/transform/mdxish/variables-code.ts
|
|
116483
|
+
|
|
116484
|
+
|
|
116485
|
+
// Single combined regex so that resolved values from one pattern are never re-scanned by the other.
|
|
116486
|
+
const COMBINED_VARIABLE_REGEX = new RegExp(`${variable_dist.VARIABLE_REGEXP}|${variable_dist.MDX_VARIABLE_REGEXP}`, 'giu');
|
|
116487
|
+
// Flatten variables into a single object for easy lookup
|
|
116488
|
+
function variables_code_flattenVariables(variables) {
|
|
116489
|
+
if (!variables)
|
|
116490
|
+
return {};
|
|
116491
|
+
return {
|
|
116492
|
+
...Object.fromEntries((variables.defaults || []).map(d => [d.name, d.default])),
|
|
116493
|
+
...variables.user,
|
|
116494
|
+
};
|
|
116495
|
+
}
|
|
116496
|
+
function resolveCodeVariables(value, resolvedVariables) {
|
|
116497
|
+
return value.replace(COMBINED_VARIABLE_REGEX, (match, legacyName, mdxEscapePrefix, mdxVarName, mdxEscapeSuffix) => {
|
|
116498
|
+
// Legacy variable: <<...>>
|
|
116499
|
+
if (legacyName !== undefined) {
|
|
116500
|
+
if (match.startsWith('\\<<') || match.endsWith('\\>>'))
|
|
116501
|
+
return match;
|
|
116502
|
+
const name = legacyName.trim();
|
|
116503
|
+
if (name.startsWith('glossary:'))
|
|
116504
|
+
return name.toUpperCase();
|
|
116505
|
+
return name in resolvedVariables ? resolvedVariables[name] : name.toUpperCase();
|
|
116506
|
+
}
|
|
116507
|
+
// MDX variable: {user.*}
|
|
116508
|
+
if (mdxEscapePrefix || mdxEscapeSuffix)
|
|
116509
|
+
return match;
|
|
116510
|
+
if (mdxVarName in resolvedVariables)
|
|
116511
|
+
return resolvedVariables[mdxVarName];
|
|
116512
|
+
const fullPath = match.slice(1, -1);
|
|
116513
|
+
return fullPath.toUpperCase();
|
|
116514
|
+
});
|
|
116515
|
+
}
|
|
116516
|
+
/**
|
|
116517
|
+
* A remark mdast plugin that resolves legacy variables <<...>> and MDX variables {user.*} inside code and inline code nodes
|
|
116518
|
+
* to their values. Uses regexes from the readme variable to search for variables in the code string.
|
|
116519
|
+
*
|
|
116520
|
+
* This is needed because variables in code blocks and inline cannot be tokenized, and also we need to maintain the code string
|
|
116521
|
+
* in the code nodes. This enables engine side variable resolution in codes which improves UX
|
|
116522
|
+
*/
|
|
116523
|
+
const variablesCodeResolver = ({ variables } = {}) => tree => {
|
|
116524
|
+
const resolvedVariables = variables_code_flattenVariables(variables);
|
|
116525
|
+
visit(tree, 'inlineCode', (node) => {
|
|
116526
|
+
if (!node.value)
|
|
116527
|
+
return;
|
|
116528
|
+
node.value = resolveCodeVariables(node.value, resolvedVariables);
|
|
116529
|
+
});
|
|
116530
|
+
visit(tree, 'code', (node) => {
|
|
116531
|
+
if (!node.value)
|
|
116532
|
+
return;
|
|
116533
|
+
const nextValue = resolveCodeVariables(node.value, resolvedVariables);
|
|
116534
|
+
node.value = nextValue;
|
|
116535
|
+
// Keep code-tabs/readme-components hProperties in sync with node.value
|
|
116536
|
+
// because renderers read `value` from hProperties.
|
|
116537
|
+
if (node.data?.hProperties && typeof node.data.hProperties === 'object') {
|
|
116538
|
+
node.data.hProperties.value = nextValue;
|
|
116539
|
+
}
|
|
116540
|
+
});
|
|
116541
|
+
return tree;
|
|
116542
|
+
};
|
|
116543
|
+
/* harmony default export */ const variables_code = (variablesCodeResolver);
|
|
116544
|
+
|
|
116107
116545
|
;// ./processor/transform/mdxish/variables-text.ts
|
|
116108
116546
|
|
|
116109
116547
|
|
|
@@ -116173,7 +116611,7 @@ const variablesTextTransformer = () => tree => {
|
|
|
116173
116611
|
/* harmony default export */ const variables_text = (variablesTextTransformer);
|
|
116174
116612
|
|
|
116175
116613
|
;// ./lib/mdast-util/magic-block/index.ts
|
|
116176
|
-
const
|
|
116614
|
+
const magic_block_contextMap = new WeakMap();
|
|
116177
116615
|
/**
|
|
116178
116616
|
* Find the magicBlock token in the token ancestry.
|
|
116179
116617
|
*/
|
|
@@ -116193,7 +116631,7 @@ function findMagicBlockToken() {
|
|
|
116193
116631
|
*/
|
|
116194
116632
|
function enterMagicBlock(token) {
|
|
116195
116633
|
// Initialize context for this magic block
|
|
116196
|
-
|
|
116634
|
+
magic_block_contextMap.set(token, { blockType: '', dataChunks: [] });
|
|
116197
116635
|
this.enter({
|
|
116198
116636
|
type: 'magicBlock',
|
|
116199
116637
|
blockType: '',
|
|
@@ -116208,7 +116646,7 @@ function exitMagicBlockType(token) {
|
|
|
116208
116646
|
const blockToken = findMagicBlockToken.call(this);
|
|
116209
116647
|
if (!blockToken)
|
|
116210
116648
|
return;
|
|
116211
|
-
const context =
|
|
116649
|
+
const context = magic_block_contextMap.get(blockToken);
|
|
116212
116650
|
if (context) {
|
|
116213
116651
|
context.blockType = this.sliceSerialize(token);
|
|
116214
116652
|
}
|
|
@@ -116220,7 +116658,7 @@ function exitMagicBlockData(token) {
|
|
|
116220
116658
|
const blockToken = findMagicBlockToken.call(this);
|
|
116221
116659
|
if (!blockToken)
|
|
116222
116660
|
return;
|
|
116223
|
-
const context =
|
|
116661
|
+
const context = magic_block_contextMap.get(blockToken);
|
|
116224
116662
|
if (context) {
|
|
116225
116663
|
context.dataChunks.push(this.sliceSerialize(token));
|
|
116226
116664
|
}
|
|
@@ -116232,7 +116670,7 @@ function exitMagicBlockLineEnding(token) {
|
|
|
116232
116670
|
const blockToken = findMagicBlockToken.call(this);
|
|
116233
116671
|
if (!blockToken)
|
|
116234
116672
|
return;
|
|
116235
|
-
const context =
|
|
116673
|
+
const context = magic_block_contextMap.get(blockToken);
|
|
116236
116674
|
if (context) {
|
|
116237
116675
|
context.dataChunks.push(this.sliceSerialize(token));
|
|
116238
116676
|
}
|
|
@@ -116250,7 +116688,7 @@ function exitMagicBlockMarkerEnd(token) {
|
|
|
116250
116688
|
// If this marker doesn't end with ']', it's a failed check and content belongs to data
|
|
116251
116689
|
// The successful end marker would be "[/block]"
|
|
116252
116690
|
if (!markerContent.endsWith(']') || markerContent !== '[/block]') {
|
|
116253
|
-
const context =
|
|
116691
|
+
const context = magic_block_contextMap.get(blockToken);
|
|
116254
116692
|
if (context) {
|
|
116255
116693
|
context.dataChunks.push(markerContent);
|
|
116256
116694
|
}
|
|
@@ -116260,7 +116698,7 @@ function exitMagicBlockMarkerEnd(token) {
|
|
|
116260
116698
|
* Exit handler: Finalize the magicBlock node with parsed JSON data.
|
|
116261
116699
|
*/
|
|
116262
116700
|
function exitMagicBlock(token) {
|
|
116263
|
-
const context =
|
|
116701
|
+
const context = magic_block_contextMap.get(token);
|
|
116264
116702
|
const node = this.stack[this.stack.length - 1];
|
|
116265
116703
|
if (context) {
|
|
116266
116704
|
const rawJson = context.dataChunks.join('');
|
|
@@ -116275,7 +116713,7 @@ function exitMagicBlock(token) {
|
|
|
116275
116713
|
node.data = {};
|
|
116276
116714
|
}
|
|
116277
116715
|
// Clean up context
|
|
116278
|
-
|
|
116716
|
+
magic_block_contextMap.delete(token);
|
|
116279
116717
|
}
|
|
116280
116718
|
this.exit(token);
|
|
116281
116719
|
}
|
|
@@ -116328,166 +116766,6 @@ function magicBlockToMarkdown() {
|
|
|
116328
116766
|
};
|
|
116329
116767
|
}
|
|
116330
116768
|
|
|
116331
|
-
;// ./node_modules/micromark-util-symbol/lib/codes.js
|
|
116332
|
-
/**
|
|
116333
|
-
* Character codes.
|
|
116334
|
-
*
|
|
116335
|
-
* This module is compiled away!
|
|
116336
|
-
*
|
|
116337
|
-
* micromark works based on character codes.
|
|
116338
|
-
* This module contains constants for the ASCII block and the replacement
|
|
116339
|
-
* character.
|
|
116340
|
-
* A couple of them are handled in a special way, such as the line endings
|
|
116341
|
-
* (CR, LF, and CR+LF, commonly known as end-of-line: EOLs), the tab (horizontal
|
|
116342
|
-
* tab) and its expansion based on what column it’s at (virtual space),
|
|
116343
|
-
* and the end-of-file (eof) character.
|
|
116344
|
-
* As values are preprocessed before handling them, the actual characters LF,
|
|
116345
|
-
* CR, HT, and NUL (which is present as the replacement character), are
|
|
116346
|
-
* guaranteed to not exist.
|
|
116347
|
-
*
|
|
116348
|
-
* Unicode basic latin block.
|
|
116349
|
-
*/
|
|
116350
|
-
const codes = /** @type {const} */ ({
|
|
116351
|
-
carriageReturn: -5,
|
|
116352
|
-
lineFeed: -4,
|
|
116353
|
-
carriageReturnLineFeed: -3,
|
|
116354
|
-
horizontalTab: -2,
|
|
116355
|
-
virtualSpace: -1,
|
|
116356
|
-
eof: null,
|
|
116357
|
-
nul: 0,
|
|
116358
|
-
soh: 1,
|
|
116359
|
-
stx: 2,
|
|
116360
|
-
etx: 3,
|
|
116361
|
-
eot: 4,
|
|
116362
|
-
enq: 5,
|
|
116363
|
-
ack: 6,
|
|
116364
|
-
bel: 7,
|
|
116365
|
-
bs: 8,
|
|
116366
|
-
ht: 9, // `\t`
|
|
116367
|
-
lf: 10, // `\n`
|
|
116368
|
-
vt: 11, // `\v`
|
|
116369
|
-
ff: 12, // `\f`
|
|
116370
|
-
cr: 13, // `\r`
|
|
116371
|
-
so: 14,
|
|
116372
|
-
si: 15,
|
|
116373
|
-
dle: 16,
|
|
116374
|
-
dc1: 17,
|
|
116375
|
-
dc2: 18,
|
|
116376
|
-
dc3: 19,
|
|
116377
|
-
dc4: 20,
|
|
116378
|
-
nak: 21,
|
|
116379
|
-
syn: 22,
|
|
116380
|
-
etb: 23,
|
|
116381
|
-
can: 24,
|
|
116382
|
-
em: 25,
|
|
116383
|
-
sub: 26,
|
|
116384
|
-
esc: 27,
|
|
116385
|
-
fs: 28,
|
|
116386
|
-
gs: 29,
|
|
116387
|
-
rs: 30,
|
|
116388
|
-
us: 31,
|
|
116389
|
-
space: 32,
|
|
116390
|
-
exclamationMark: 33, // `!`
|
|
116391
|
-
quotationMark: 34, // `"`
|
|
116392
|
-
numberSign: 35, // `#`
|
|
116393
|
-
dollarSign: 36, // `$`
|
|
116394
|
-
percentSign: 37, // `%`
|
|
116395
|
-
ampersand: 38, // `&`
|
|
116396
|
-
apostrophe: 39, // `'`
|
|
116397
|
-
leftParenthesis: 40, // `(`
|
|
116398
|
-
rightParenthesis: 41, // `)`
|
|
116399
|
-
asterisk: 42, // `*`
|
|
116400
|
-
plusSign: 43, // `+`
|
|
116401
|
-
comma: 44, // `,`
|
|
116402
|
-
dash: 45, // `-`
|
|
116403
|
-
dot: 46, // `.`
|
|
116404
|
-
slash: 47, // `/`
|
|
116405
|
-
digit0: 48, // `0`
|
|
116406
|
-
digit1: 49, // `1`
|
|
116407
|
-
digit2: 50, // `2`
|
|
116408
|
-
digit3: 51, // `3`
|
|
116409
|
-
digit4: 52, // `4`
|
|
116410
|
-
digit5: 53, // `5`
|
|
116411
|
-
digit6: 54, // `6`
|
|
116412
|
-
digit7: 55, // `7`
|
|
116413
|
-
digit8: 56, // `8`
|
|
116414
|
-
digit9: 57, // `9`
|
|
116415
|
-
colon: 58, // `:`
|
|
116416
|
-
semicolon: 59, // `;`
|
|
116417
|
-
lessThan: 60, // `<`
|
|
116418
|
-
equalsTo: 61, // `=`
|
|
116419
|
-
greaterThan: 62, // `>`
|
|
116420
|
-
questionMark: 63, // `?`
|
|
116421
|
-
atSign: 64, // `@`
|
|
116422
|
-
uppercaseA: 65, // `A`
|
|
116423
|
-
uppercaseB: 66, // `B`
|
|
116424
|
-
uppercaseC: 67, // `C`
|
|
116425
|
-
uppercaseD: 68, // `D`
|
|
116426
|
-
uppercaseE: 69, // `E`
|
|
116427
|
-
uppercaseF: 70, // `F`
|
|
116428
|
-
uppercaseG: 71, // `G`
|
|
116429
|
-
uppercaseH: 72, // `H`
|
|
116430
|
-
uppercaseI: 73, // `I`
|
|
116431
|
-
uppercaseJ: 74, // `J`
|
|
116432
|
-
uppercaseK: 75, // `K`
|
|
116433
|
-
uppercaseL: 76, // `L`
|
|
116434
|
-
uppercaseM: 77, // `M`
|
|
116435
|
-
uppercaseN: 78, // `N`
|
|
116436
|
-
uppercaseO: 79, // `O`
|
|
116437
|
-
uppercaseP: 80, // `P`
|
|
116438
|
-
uppercaseQ: 81, // `Q`
|
|
116439
|
-
uppercaseR: 82, // `R`
|
|
116440
|
-
uppercaseS: 83, // `S`
|
|
116441
|
-
uppercaseT: 84, // `T`
|
|
116442
|
-
uppercaseU: 85, // `U`
|
|
116443
|
-
uppercaseV: 86, // `V`
|
|
116444
|
-
uppercaseW: 87, // `W`
|
|
116445
|
-
uppercaseX: 88, // `X`
|
|
116446
|
-
uppercaseY: 89, // `Y`
|
|
116447
|
-
uppercaseZ: 90, // `Z`
|
|
116448
|
-
leftSquareBracket: 91, // `[`
|
|
116449
|
-
backslash: 92, // `\`
|
|
116450
|
-
rightSquareBracket: 93, // `]`
|
|
116451
|
-
caret: 94, // `^`
|
|
116452
|
-
underscore: 95, // `_`
|
|
116453
|
-
graveAccent: 96, // `` ` ``
|
|
116454
|
-
lowercaseA: 97, // `a`
|
|
116455
|
-
lowercaseB: 98, // `b`
|
|
116456
|
-
lowercaseC: 99, // `c`
|
|
116457
|
-
lowercaseD: 100, // `d`
|
|
116458
|
-
lowercaseE: 101, // `e`
|
|
116459
|
-
lowercaseF: 102, // `f`
|
|
116460
|
-
lowercaseG: 103, // `g`
|
|
116461
|
-
lowercaseH: 104, // `h`
|
|
116462
|
-
lowercaseI: 105, // `i`
|
|
116463
|
-
lowercaseJ: 106, // `j`
|
|
116464
|
-
lowercaseK: 107, // `k`
|
|
116465
|
-
lowercaseL: 108, // `l`
|
|
116466
|
-
lowercaseM: 109, // `m`
|
|
116467
|
-
lowercaseN: 110, // `n`
|
|
116468
|
-
lowercaseO: 111, // `o`
|
|
116469
|
-
lowercaseP: 112, // `p`
|
|
116470
|
-
lowercaseQ: 113, // `q`
|
|
116471
|
-
lowercaseR: 114, // `r`
|
|
116472
|
-
lowercaseS: 115, // `s`
|
|
116473
|
-
lowercaseT: 116, // `t`
|
|
116474
|
-
lowercaseU: 117, // `u`
|
|
116475
|
-
lowercaseV: 118, // `v`
|
|
116476
|
-
lowercaseW: 119, // `w`
|
|
116477
|
-
lowercaseX: 120, // `x`
|
|
116478
|
-
lowercaseY: 121, // `y`
|
|
116479
|
-
lowercaseZ: 122, // `z`
|
|
116480
|
-
leftCurlyBrace: 123, // `{`
|
|
116481
|
-
verticalBar: 124, // `|`
|
|
116482
|
-
rightCurlyBrace: 125, // `}`
|
|
116483
|
-
tilde: 126, // `~`
|
|
116484
|
-
del: 127,
|
|
116485
|
-
// Unicode Specials block.
|
|
116486
|
-
byteOrderMarker: 65_279,
|
|
116487
|
-
// Unicode Specials block.
|
|
116488
|
-
replacementCharacter: 65_533 // `�`
|
|
116489
|
-
})
|
|
116490
|
-
|
|
116491
116769
|
;// ./lib/micromark/magic-block/syntax.ts
|
|
116492
116770
|
|
|
116493
116771
|
|
|
@@ -117407,6 +117685,9 @@ function loadComponents() {
|
|
|
117407
117685
|
|
|
117408
117686
|
|
|
117409
117687
|
|
|
117688
|
+
|
|
117689
|
+
|
|
117690
|
+
|
|
117410
117691
|
|
|
117411
117692
|
|
|
117412
117693
|
|
|
@@ -117454,8 +117735,10 @@ function mdxishAstProcessor(mdContent, opts = {}) {
|
|
|
117454
117735
|
text: mdxExprExt.text,
|
|
117455
117736
|
};
|
|
117456
117737
|
const processor = unified()
|
|
117457
|
-
.data('micromarkExtensions', safeMode ? [magicBlock()] : [magicBlock(), mdxExprTextOnly])
|
|
117458
|
-
.data('fromMarkdownExtensions', safeMode
|
|
117738
|
+
.data('micromarkExtensions', safeMode ? [magicBlock(), legacyVariable()] : [magicBlock(), mdxExprTextOnly, legacyVariable()])
|
|
117739
|
+
.data('fromMarkdownExtensions', safeMode
|
|
117740
|
+
? [magicBlockFromMarkdown(), legacyVariableFromMarkdown()]
|
|
117741
|
+
: [magicBlockFromMarkdown(), mdxExpressionFromMarkdown(), legacyVariableFromMarkdown()])
|
|
117459
117742
|
.use(remarkParse)
|
|
117460
117743
|
.use(remarkFrontmatter)
|
|
117461
117744
|
.use(normalize_malformed_md_syntax)
|
|
@@ -117502,7 +117785,7 @@ function mdxishMdastToMd(mdast) {
|
|
|
117502
117785
|
* @see {@link https://github.com/readmeio/rmdx/blob/main/docs/mdxish-flow.md}
|
|
117503
117786
|
*/
|
|
117504
117787
|
function mdxish(mdContent, opts = {}) {
|
|
117505
|
-
const { components: userComponents = {} } = opts;
|
|
117788
|
+
const { components: userComponents = {}, variables } = opts;
|
|
117506
117789
|
const components = {
|
|
117507
117790
|
...loadComponents(),
|
|
117508
117791
|
...userComponents,
|
|
@@ -117510,12 +117793,13 @@ function mdxish(mdContent, opts = {}) {
|
|
|
117510
117793
|
const { processor, parserReadyContent } = mdxishAstProcessor(mdContent, opts);
|
|
117511
117794
|
processor
|
|
117512
117795
|
.use(remarkBreaks)
|
|
117796
|
+
.use(variables_code, { variables }) // Resolve <<...>> and {user.*} inside code and inline code nodes
|
|
117513
117797
|
.use(remarkRehype, { allowDangerousHtml: true, handlers: mdxComponentHandlers })
|
|
117514
117798
|
.use(preserveBooleanProperties) // RehypeRaw converts boolean properties to empty strings
|
|
117515
117799
|
.use(rehypeRaw, { passThrough: ['html-block'] })
|
|
117516
117800
|
.use(restoreBooleanProperties)
|
|
117517
117801
|
.use(mdxish_mermaid) // Add mermaid-render className to pre wrappers
|
|
117518
|
-
.use(
|
|
117802
|
+
.use(heading_slugs)
|
|
117519
117803
|
.use(rehypeMdxishComponents, {
|
|
117520
117804
|
components,
|
|
117521
117805
|
processMarkdown: (markdown) => mdxish(markdown, opts),
|
|
@@ -117655,9 +117939,6 @@ const migrate = (doc, opts) => {
|
|
|
117655
117939
|
};
|
|
117656
117940
|
/* harmony default export */ const lib_migrate = (migrate);
|
|
117657
117941
|
|
|
117658
|
-
// EXTERNAL MODULE: ./node_modules/@readme/variable/dist/index.js
|
|
117659
|
-
var variable_dist = __webpack_require__(4355);
|
|
117660
|
-
var variable_dist_default = /*#__PURE__*/__webpack_require__.n(variable_dist);
|
|
117661
117942
|
// EXTERNAL MODULE: ./node_modules/rehype-react/index.js
|
|
117662
117943
|
var rehype_react = __webpack_require__(26);
|
|
117663
117944
|
var rehype_react_default = /*#__PURE__*/__webpack_require__.n(rehype_react);
|