@readme/markdown 13.2.0 → 13.4.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/components/Code/style.scss +1 -1
- 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 +9 -0
- package/dist/main.css +1 -1
- package/dist/main.css.map +1 -1
- package/dist/main.js +515 -205
- package/dist/main.node.js +515 -205
- package/dist/main.node.js.map +1 -1
- package/dist/processor/transform/mdxish/heading-slugs.d.ts +8 -0
- package/dist/processor/transform/mdxish/preprocess-jsx-expressions.d.ts +12 -0
- package/dist/processor/transform/mdxish/variables-code.d.ts +14 -0
- package/dist/processor/transform/mdxish/variables-text.d.ts +6 -2
- 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\u0984\u098D\u098E\u0991\u0992\u09A9\u09B1\u09B3-\u09B5\u09BA\u09BB\u09C5\u09C6\u09C9\u09CA\u09CF-\u09D6\u09D8-\u09DB\u09DE\u09E4\u09E5\u09F2-\u09FB\u09FD\u09FF\u0A00\u0A04\u0A0B-\u0A0E\u0A11\u0A12\u0A29\u0A31\u0A34\u0A37\u0A3A\u0A3B\u0A3D\u0A43-\u0A46\u0A49\u0A4A\u0A4E-\u0A50\u0A52-\u0A58\u0A5D\u0A5F-\u0A65\u0A76-\u0A80\u0A84\u0A8E\u0A92\u0AA9\u0AB1\u0AB4\u0ABA\u0ABB\u0AC6\u0ACA\u0ACE\u0ACF\u0AD1-\u0ADF\u0AE4\u0AE5\u0AF0-\u0AF8\u0B00\u0B04\u0B0D\u0B0E\u0B11\u0B12\u0B29\u0B31\u0B34\u0B3A\u0B3B\u0B45\u0B46\u0B49\u0B4A\u0B4E-\u0B54\u0B58-\u0B5B\u0B5E\u0B64\u0B65\u0B70\u0B72-\u0B81\u0B84\u0B8B-\u0B8D\u0B91\u0B96-\u0B98\u0B9B\u0B9D\u0BA0-\u0BA2\u0BA5-\u0BA7\u0BAB-\u0BAD\u0BBA-\u0BBD\u0BC3-\u0BC5\u0BC9\u0BCE\u0BCF\u0BD1-\u0BD6\u0BD8-\u0BE5\u0BF0-\u0BFF\u0C0D\u0C11\u0C29\u0C3A-\u0C3C\u0C45\u0C49\u0C4E-\u0C54\u0C57\u0C5B-\u0C5F\u0C64\u0C65\u0C70-\u0C7F\u0C84\u0C8D\u0C91\u0CA9\u0CB4\u0CBA\u0CBB\u0CC5\u0CC9\u0CCE-\u0CD4\u0CD7-\u0CDD\u0CDF\u0CE4\u0CE5\u0CF0\u0CF3-\u0CFF\u0D0D\u0D11\u0D45\u0D49\u0D4F-\u0D53\u0D58-\u0D5E\u0D64\u0D65\u0D70-\u0D79\u0D80\u0D84\u0D97-\u0D99\u0DB2\u0DBC\u0DBE\u0DBF\u0DC7-\u0DC9\u0DCB-\u0DCE\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-\uD7CA\uD7FC-\uD7FF\uE000-\uF8FF\uFA6E\uFA6F\uFADA-\uFAFF\uFB07-\uFB12\uFB18-\uFB1C\uFB29\uFB37\uFB3D\uFB3F\uFB42\uFB45\uFBB2-\uFBD2\uFD3E-\uFD4F\uFD90\uFD91\uFDC8-\uFDEF\uFDFC-\uFDFF\uFE10-\uFE1F\uFE30-\uFE32\uFE35-\uFE4C\uFE50-\uFE6F\uFE75\uFEFD-\uFF0F\uFF1A-\uFF20\uFF3B-\uFF3E\uFF40\uFF5B-\uFF65\uFFBF-\uFFC1\uFFC8\uFFC9\uFFD0\uFFD1\uFFD8\uFFD9\uFFDD-\uFFFF]|\uD800[\uDC0C\uDC27\uDC3B\uDC3E\uDC4E\uDC4F\uDC5E-\uDC7F\uDCFB-\uDD3F\uDD75-\uDDFC\uDDFE-\uDE7F\uDE9D-\uDE9F\uDED1-\uDEDF\uDEE1-\uDEFF\uDF20-\uDF2C\uDF4B-\uDF4F\uDF7B-\uDF7F\uDF9E\uDF9F\uDFC4-\uDFC7\uDFD0\uDFD6-\uDFFF]|\uD801[\uDC9E\uDC9F\uDCAA-\uDCAF\uDCD4-\uDCD7\uDCFC-\uDCFF\uDD28-\uDD2F\uDD64-\uDDFF\uDF37-\uDF3F\uDF56-\uDF5F\uDF68-\uDFFF]|\uD802[\uDC06\uDC07\uDC09\uDC36\uDC39-\uDC3B\uDC3D\uDC3E\uDC56-\uDC5F\uDC77-\uDC7F\uDC9F-\uDCDF\uDCF3\uDCF6-\uDCFF\uDD16-\uDD1F\uDD3A-\uDD7F\uDDB8-\uDDBD\uDDC0-\uDDFF\uDE04\uDE07-\uDE0B\uDE14\uDE18\uDE36\uDE37\uDE3B-\uDE3E\uDE40-\uDE5F\uDE7D-\uDE7F\uDE9D-\uDEBF\uDEC8\uDEE7-\uDEFF\uDF36-\uDF3F\uDF56-\uDF5F\uDF73-\uDF7F\uDF92-\uDFFF]|\uD803[\uDC49-\uDC7F\uDCB3-\uDCBF\uDCF3-\uDCFF\uDD28-\uDD2F\uDD3A-\uDE7F\uDEAA\uDEAD-\uDEAF\uDEB2-\uDEFF\uDF1D-\uDF26\uDF28-\uDF2F\uDF51-\uDFAF\uDFC5-\uDFDF\uDFF7-\uDFFF]|\uD804[\uDC47-\uDC65\uDC70-\uDC7E\uDCBB-\uDCCF\uDCE9-\uDCEF\uDCFA-\uDCFF\uDD35\uDD40-\uDD43\uDD48-\uDD4F\uDD74\uDD75\uDD77-\uDD7F\uDDC5-\uDDC8\uDDCD\uDDDB\uDDDD-\uDDFF\uDE12\uDE38-\uDE3D\uDE3F-\uDE7F\uDE87\uDE89\uDE8E\uDE9E\uDEA9-\uDEAF\uDEEB-\uDEEF\uDEFA-\uDEFF\uDF04\uDF0D\uDF0E\uDF11\uDF12\uDF29\uDF31\uDF34\uDF3A\uDF45\uDF46\uDF49\uDF4A\uDF4E\uDF4F\uDF51-\uDF56\uDF58-\uDF5C\uDF64\uDF65\uDF6D-\uDF6F\uDF75-\uDFFF]|\uD805[\uDC4B-\uDC4F\uDC5A-\uDC5D\uDC62-\uDC7F\uDCC6\uDCC8-\uDCCF\uDCDA-\uDD7F\uDDB6\uDDB7\uDDC1-\uDDD7\uDDDE-\uDDFF\uDE41-\uDE43\uDE45-\uDE4F\uDE5A-\uDE7F\uDEB9-\uDEBF\uDECA-\uDEFF\uDF1B\uDF1C\uDF2C-\uDF2F\uDF3A-\uDFFF]|\uD806[\uDC3B-\uDC9F\uDCEA-\uDCFE\uDD07\uDD08\uDD0A\uDD0B\uDD14\uDD17\uDD36\uDD39\uDD3A\uDD44-\uDD4F\uDD5A-\uDD9F\uDDA8\uDDA9\uDDD8\uDDD9\uDDE2\uDDE5-\uDDFF\uDE3F-\uDE46\uDE48-\uDE4F\uDE9A-\uDE9C\uDE9E-\uDEBF\uDEF9-\uDFFF]|\uD807[\uDC09\uDC37\uDC41-\uDC4F\uDC5A-\uDC71\uDC90\uDC91\uDCA8\uDCB7-\uDCFF\uDD07\uDD0A\uDD37-\uDD39\uDD3B\uDD3E\uDD48-\uDD4F\uDD5A-\uDD5F\uDD66\uDD69\uDD8F\uDD92\uDD99-\uDD9F\uDDAA-\uDEDF\uDEF7-\uDFAF\uDFB1-\uDFFF]|\uD808[\uDF9A-\uDFFF]|\uD809[\uDC6F-\uDC7F\uDD44-\uDFFF]|[\uD80A\uD80B\uD80E-\uD810\uD812-\uD819\uD824-\uD82B\uD82D\uD82E\uD830-\uD833\uD837\uD839\uD83D\uD83F\uD87B-\uD87D\uD87F\uD885-\uDB3F\uDB41-\uDBFF][\uDC00-\uDFFF]|\uD80D[\uDC2F-\uDFFF]|\uD811[\uDE47-\uDFFF]|\uD81A[\uDE39-\uDE3F\uDE5F\uDE6A-\uDECF\uDEEE\uDEEF\uDEF5-\uDEFF\uDF37-\uDF3F\uDF44-\uDF4F\uDF5A-\uDF62\uDF78-\uDF7C\uDF90-\uDFFF]|\uD81B[\uDC00-\uDE3F\uDE80-\uDEFF\uDF4B-\uDF4E\uDF88-\uDF8E\uDFA0-\uDFDF\uDFE2\uDFE5-\uDFEF\uDFF2-\uDFFF]|\uD821[\uDFF8-\uDFFF]|\uD823[\uDCD6-\uDCFF\uDD09-\uDFFF]|\uD82C[\uDD1F-\uDD4F\uDD53-\uDD63\uDD68-\uDD6F\uDEFC-\uDFFF]|\uD82F[\uDC6B-\uDC6F\uDC7D-\uDC7F\uDC89-\uDC8F\uDC9A-\uDC9C\uDC9F-\uDFFF]|\uD834[\uDC00-\uDD64\uDD6A-\uDD6C\uDD73-\uDD7A\uDD83\uDD84\uDD8C-\uDDA9\uDDAE-\uDE41\uDE45-\uDFFF]|\uD835[\uDC55\uDC9D\uDCA0\uDCA1\uDCA3\uDCA4\uDCA7\uDCA8\uDCAD\uDCBA\uDCBC\uDCC4\uDD06\uDD0B\uDD0C\uDD15\uDD1D\uDD3A\uDD3F\uDD45\uDD47-\uDD49\uDD51\uDEA6\uDEA7\uDEC1\uDEDB\uDEFB\uDF15\uDF35\uDF4F\uDF6F\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
|
|
@@ -73132,6 +73132,12 @@ const stripCommentsTransformer = () => {
|
|
|
73132
73132
|
|
|
73133
73133
|
|
|
73134
73134
|
const STRIP_TAGS = ['script', 'style'];
|
|
73135
|
+
/** Valid JS identifier: starts with $, _, or a letter; followed by $, _, letters, digits, etc. */
|
|
73136
|
+
const JS_IDENTIFIER_RE = /^[$_\p{L}][$_\p{L}\p{Mn}\p{Mc}\p{Nd}\p{Pc}\u200C\u200D]*$/u;
|
|
73137
|
+
/** Format a variable key as MDX syntax, using bracket notation for non-identifier keys (e.g. hyphens). */
|
|
73138
|
+
function toMdxVariableSyntax(key) {
|
|
73139
|
+
return JS_IDENTIFIER_RE.test(key) ? `{user.${key}}` : `{user["${key}"]}`;
|
|
73140
|
+
}
|
|
73135
73141
|
/**
|
|
73136
73142
|
* Extract variable key from MDX expression AST (e.g., {user.name} → 'name')
|
|
73137
73143
|
* Uses ESTree AST inspection, matching the approach in processor/transform/variables.ts
|
|
@@ -73190,6 +73196,9 @@ function plain_one(node, opts) {
|
|
|
73190
73196
|
case 'variable':
|
|
73191
73197
|
case 'Variable': {
|
|
73192
73198
|
const key = node.properties.name.toString();
|
|
73199
|
+
if (opts.preserveVariableSyntax) {
|
|
73200
|
+
return node.properties.isLegacy ? `<<${key}>>` : toMdxVariableSyntax(key);
|
|
73201
|
+
}
|
|
73193
73202
|
const val = 'variables' in opts && opts.variables[key];
|
|
73194
73203
|
return val || key;
|
|
73195
73204
|
}
|
|
@@ -73213,6 +73222,8 @@ function plain_one(node, opts) {
|
|
|
73213
73222
|
if (node.type === 'mdxTextExpression') {
|
|
73214
73223
|
const key = extractMdxVariableKey(node);
|
|
73215
73224
|
if (key) {
|
|
73225
|
+
if (opts.preserveVariableSyntax)
|
|
73226
|
+
return toMdxVariableSyntax(key);
|
|
73216
73227
|
return ('variables' in opts && opts.variables[key]) || key;
|
|
73217
73228
|
}
|
|
73218
73229
|
}
|
|
@@ -91037,9 +91048,320 @@ const mdxToHast = () => tree => {
|
|
|
91037
91048
|
};
|
|
91038
91049
|
/* harmony default export */ const mdx_to_hast = (mdxToHast);
|
|
91039
91050
|
|
|
91051
|
+
;// ./lib/mdast-util/legacy-variable/index.ts
|
|
91052
|
+
|
|
91053
|
+
const contextMap = new WeakMap();
|
|
91054
|
+
function findlegacyVariableToken() {
|
|
91055
|
+
// tokenStack is micromark's current open token ancestry; find the nearest legacyVariable token.
|
|
91056
|
+
const events = this.tokenStack;
|
|
91057
|
+
for (let i = events.length - 1; i >= 0; i -= 1) {
|
|
91058
|
+
const token = events[i][0];
|
|
91059
|
+
if (token.type === 'legacyVariable')
|
|
91060
|
+
return token;
|
|
91061
|
+
}
|
|
91062
|
+
return undefined;
|
|
91063
|
+
}
|
|
91064
|
+
function enterlegacyVariable(token) {
|
|
91065
|
+
contextMap.set(token, { value: '' });
|
|
91066
|
+
}
|
|
91067
|
+
function exitlegacyVariableValue(token) {
|
|
91068
|
+
const variableToken = findlegacyVariableToken.call(this);
|
|
91069
|
+
if (!variableToken)
|
|
91070
|
+
return;
|
|
91071
|
+
const ctx = contextMap.get(variableToken);
|
|
91072
|
+
// Build up the variable characters
|
|
91073
|
+
if (ctx)
|
|
91074
|
+
ctx.value += this.sliceSerialize(token);
|
|
91075
|
+
}
|
|
91076
|
+
function exitlegacyVariable(token) {
|
|
91077
|
+
const ctx = contextMap.get(token);
|
|
91078
|
+
const serialized = this.sliceSerialize(token);
|
|
91079
|
+
const variableName = serialized.startsWith('<<') && serialized.endsWith('>>')
|
|
91080
|
+
? serialized.slice(2, -2)
|
|
91081
|
+
: ctx?.value ?? '';
|
|
91082
|
+
const nodePosition = {
|
|
91083
|
+
start: {
|
|
91084
|
+
offset: token.start.offset,
|
|
91085
|
+
line: token.start.line,
|
|
91086
|
+
column: token.start.column,
|
|
91087
|
+
},
|
|
91088
|
+
end: {
|
|
91089
|
+
offset: token.end.offset,
|
|
91090
|
+
line: token.end.line,
|
|
91091
|
+
column: token.end.column,
|
|
91092
|
+
},
|
|
91093
|
+
};
|
|
91094
|
+
if (variableName.startsWith('glossary:')) {
|
|
91095
|
+
const term = variableName.slice('glossary:'.length).trim();
|
|
91096
|
+
this.enter({
|
|
91097
|
+
type: NodeTypes.glossary,
|
|
91098
|
+
data: {
|
|
91099
|
+
hName: 'Glossary',
|
|
91100
|
+
hProperties: { term },
|
|
91101
|
+
},
|
|
91102
|
+
children: [{ type: 'text', value: term }],
|
|
91103
|
+
position: nodePosition,
|
|
91104
|
+
}, token);
|
|
91105
|
+
this.exit(token);
|
|
91106
|
+
contextMap.delete(token);
|
|
91107
|
+
return;
|
|
91108
|
+
}
|
|
91109
|
+
this.enter({
|
|
91110
|
+
type: NodeTypes.variable,
|
|
91111
|
+
data: {
|
|
91112
|
+
hName: 'Variable',
|
|
91113
|
+
hProperties: { name: variableName.trim(), isLegacy: true },
|
|
91114
|
+
},
|
|
91115
|
+
value: `<<${variableName}>>`,
|
|
91116
|
+
}, token);
|
|
91117
|
+
this.exit(token);
|
|
91118
|
+
contextMap.delete(token);
|
|
91119
|
+
}
|
|
91120
|
+
function legacyVariableFromMarkdown() {
|
|
91121
|
+
return {
|
|
91122
|
+
enter: {
|
|
91123
|
+
legacyVariable: enterlegacyVariable,
|
|
91124
|
+
},
|
|
91125
|
+
exit: {
|
|
91126
|
+
legacyVariableValue: exitlegacyVariableValue,
|
|
91127
|
+
legacyVariable: exitlegacyVariable,
|
|
91128
|
+
},
|
|
91129
|
+
};
|
|
91130
|
+
}
|
|
91131
|
+
|
|
91132
|
+
;// ./node_modules/micromark-util-symbol/lib/codes.js
|
|
91133
|
+
/**
|
|
91134
|
+
* Character codes.
|
|
91135
|
+
*
|
|
91136
|
+
* This module is compiled away!
|
|
91137
|
+
*
|
|
91138
|
+
* micromark works based on character codes.
|
|
91139
|
+
* This module contains constants for the ASCII block and the replacement
|
|
91140
|
+
* character.
|
|
91141
|
+
* A couple of them are handled in a special way, such as the line endings
|
|
91142
|
+
* (CR, LF, and CR+LF, commonly known as end-of-line: EOLs), the tab (horizontal
|
|
91143
|
+
* tab) and its expansion based on what column it’s at (virtual space),
|
|
91144
|
+
* and the end-of-file (eof) character.
|
|
91145
|
+
* As values are preprocessed before handling them, the actual characters LF,
|
|
91146
|
+
* CR, HT, and NUL (which is present as the replacement character), are
|
|
91147
|
+
* guaranteed to not exist.
|
|
91148
|
+
*
|
|
91149
|
+
* Unicode basic latin block.
|
|
91150
|
+
*/
|
|
91151
|
+
const codes = /** @type {const} */ ({
|
|
91152
|
+
carriageReturn: -5,
|
|
91153
|
+
lineFeed: -4,
|
|
91154
|
+
carriageReturnLineFeed: -3,
|
|
91155
|
+
horizontalTab: -2,
|
|
91156
|
+
virtualSpace: -1,
|
|
91157
|
+
eof: null,
|
|
91158
|
+
nul: 0,
|
|
91159
|
+
soh: 1,
|
|
91160
|
+
stx: 2,
|
|
91161
|
+
etx: 3,
|
|
91162
|
+
eot: 4,
|
|
91163
|
+
enq: 5,
|
|
91164
|
+
ack: 6,
|
|
91165
|
+
bel: 7,
|
|
91166
|
+
bs: 8,
|
|
91167
|
+
ht: 9, // `\t`
|
|
91168
|
+
lf: 10, // `\n`
|
|
91169
|
+
vt: 11, // `\v`
|
|
91170
|
+
ff: 12, // `\f`
|
|
91171
|
+
cr: 13, // `\r`
|
|
91172
|
+
so: 14,
|
|
91173
|
+
si: 15,
|
|
91174
|
+
dle: 16,
|
|
91175
|
+
dc1: 17,
|
|
91176
|
+
dc2: 18,
|
|
91177
|
+
dc3: 19,
|
|
91178
|
+
dc4: 20,
|
|
91179
|
+
nak: 21,
|
|
91180
|
+
syn: 22,
|
|
91181
|
+
etb: 23,
|
|
91182
|
+
can: 24,
|
|
91183
|
+
em: 25,
|
|
91184
|
+
sub: 26,
|
|
91185
|
+
esc: 27,
|
|
91186
|
+
fs: 28,
|
|
91187
|
+
gs: 29,
|
|
91188
|
+
rs: 30,
|
|
91189
|
+
us: 31,
|
|
91190
|
+
space: 32,
|
|
91191
|
+
exclamationMark: 33, // `!`
|
|
91192
|
+
quotationMark: 34, // `"`
|
|
91193
|
+
numberSign: 35, // `#`
|
|
91194
|
+
dollarSign: 36, // `$`
|
|
91195
|
+
percentSign: 37, // `%`
|
|
91196
|
+
ampersand: 38, // `&`
|
|
91197
|
+
apostrophe: 39, // `'`
|
|
91198
|
+
leftParenthesis: 40, // `(`
|
|
91199
|
+
rightParenthesis: 41, // `)`
|
|
91200
|
+
asterisk: 42, // `*`
|
|
91201
|
+
plusSign: 43, // `+`
|
|
91202
|
+
comma: 44, // `,`
|
|
91203
|
+
dash: 45, // `-`
|
|
91204
|
+
dot: 46, // `.`
|
|
91205
|
+
slash: 47, // `/`
|
|
91206
|
+
digit0: 48, // `0`
|
|
91207
|
+
digit1: 49, // `1`
|
|
91208
|
+
digit2: 50, // `2`
|
|
91209
|
+
digit3: 51, // `3`
|
|
91210
|
+
digit4: 52, // `4`
|
|
91211
|
+
digit5: 53, // `5`
|
|
91212
|
+
digit6: 54, // `6`
|
|
91213
|
+
digit7: 55, // `7`
|
|
91214
|
+
digit8: 56, // `8`
|
|
91215
|
+
digit9: 57, // `9`
|
|
91216
|
+
colon: 58, // `:`
|
|
91217
|
+
semicolon: 59, // `;`
|
|
91218
|
+
lessThan: 60, // `<`
|
|
91219
|
+
equalsTo: 61, // `=`
|
|
91220
|
+
greaterThan: 62, // `>`
|
|
91221
|
+
questionMark: 63, // `?`
|
|
91222
|
+
atSign: 64, // `@`
|
|
91223
|
+
uppercaseA: 65, // `A`
|
|
91224
|
+
uppercaseB: 66, // `B`
|
|
91225
|
+
uppercaseC: 67, // `C`
|
|
91226
|
+
uppercaseD: 68, // `D`
|
|
91227
|
+
uppercaseE: 69, // `E`
|
|
91228
|
+
uppercaseF: 70, // `F`
|
|
91229
|
+
uppercaseG: 71, // `G`
|
|
91230
|
+
uppercaseH: 72, // `H`
|
|
91231
|
+
uppercaseI: 73, // `I`
|
|
91232
|
+
uppercaseJ: 74, // `J`
|
|
91233
|
+
uppercaseK: 75, // `K`
|
|
91234
|
+
uppercaseL: 76, // `L`
|
|
91235
|
+
uppercaseM: 77, // `M`
|
|
91236
|
+
uppercaseN: 78, // `N`
|
|
91237
|
+
uppercaseO: 79, // `O`
|
|
91238
|
+
uppercaseP: 80, // `P`
|
|
91239
|
+
uppercaseQ: 81, // `Q`
|
|
91240
|
+
uppercaseR: 82, // `R`
|
|
91241
|
+
uppercaseS: 83, // `S`
|
|
91242
|
+
uppercaseT: 84, // `T`
|
|
91243
|
+
uppercaseU: 85, // `U`
|
|
91244
|
+
uppercaseV: 86, // `V`
|
|
91245
|
+
uppercaseW: 87, // `W`
|
|
91246
|
+
uppercaseX: 88, // `X`
|
|
91247
|
+
uppercaseY: 89, // `Y`
|
|
91248
|
+
uppercaseZ: 90, // `Z`
|
|
91249
|
+
leftSquareBracket: 91, // `[`
|
|
91250
|
+
backslash: 92, // `\`
|
|
91251
|
+
rightSquareBracket: 93, // `]`
|
|
91252
|
+
caret: 94, // `^`
|
|
91253
|
+
underscore: 95, // `_`
|
|
91254
|
+
graveAccent: 96, // `` ` ``
|
|
91255
|
+
lowercaseA: 97, // `a`
|
|
91256
|
+
lowercaseB: 98, // `b`
|
|
91257
|
+
lowercaseC: 99, // `c`
|
|
91258
|
+
lowercaseD: 100, // `d`
|
|
91259
|
+
lowercaseE: 101, // `e`
|
|
91260
|
+
lowercaseF: 102, // `f`
|
|
91261
|
+
lowercaseG: 103, // `g`
|
|
91262
|
+
lowercaseH: 104, // `h`
|
|
91263
|
+
lowercaseI: 105, // `i`
|
|
91264
|
+
lowercaseJ: 106, // `j`
|
|
91265
|
+
lowercaseK: 107, // `k`
|
|
91266
|
+
lowercaseL: 108, // `l`
|
|
91267
|
+
lowercaseM: 109, // `m`
|
|
91268
|
+
lowercaseN: 110, // `n`
|
|
91269
|
+
lowercaseO: 111, // `o`
|
|
91270
|
+
lowercaseP: 112, // `p`
|
|
91271
|
+
lowercaseQ: 113, // `q`
|
|
91272
|
+
lowercaseR: 114, // `r`
|
|
91273
|
+
lowercaseS: 115, // `s`
|
|
91274
|
+
lowercaseT: 116, // `t`
|
|
91275
|
+
lowercaseU: 117, // `u`
|
|
91276
|
+
lowercaseV: 118, // `v`
|
|
91277
|
+
lowercaseW: 119, // `w`
|
|
91278
|
+
lowercaseX: 120, // `x`
|
|
91279
|
+
lowercaseY: 121, // `y`
|
|
91280
|
+
lowercaseZ: 122, // `z`
|
|
91281
|
+
leftCurlyBrace: 123, // `{`
|
|
91282
|
+
verticalBar: 124, // `|`
|
|
91283
|
+
rightCurlyBrace: 125, // `}`
|
|
91284
|
+
tilde: 126, // `~`
|
|
91285
|
+
del: 127,
|
|
91286
|
+
// Unicode Specials block.
|
|
91287
|
+
byteOrderMarker: 65_279,
|
|
91288
|
+
// Unicode Specials block.
|
|
91289
|
+
replacementCharacter: 65_533 // `�`
|
|
91290
|
+
})
|
|
91291
|
+
|
|
91292
|
+
;// ./lib/micromark/legacy-variable/syntax.ts
|
|
91293
|
+
|
|
91294
|
+
|
|
91295
|
+
function isAllowedValueChar(code) {
|
|
91296
|
+
return (code !== null &&
|
|
91297
|
+
code !== codes.lessThan &&
|
|
91298
|
+
code !== codes.greaterThan &&
|
|
91299
|
+
!markdownLineEnding(code));
|
|
91300
|
+
}
|
|
91301
|
+
const legacyVariableConstruct = {
|
|
91302
|
+
name: 'legacyVariable',
|
|
91303
|
+
tokenize,
|
|
91304
|
+
};
|
|
91305
|
+
function tokenize(effects, ok, nok) {
|
|
91306
|
+
let hasValue = false;
|
|
91307
|
+
const start = (code) => {
|
|
91308
|
+
if (code !== codes.lessThan)
|
|
91309
|
+
return nok(code);
|
|
91310
|
+
effects.enter('legacyVariable');
|
|
91311
|
+
effects.enter('legacyVariableMarkerStart');
|
|
91312
|
+
effects.consume(code); // <
|
|
91313
|
+
return open2;
|
|
91314
|
+
};
|
|
91315
|
+
const open2 = (code) => {
|
|
91316
|
+
if (code !== codes.lessThan)
|
|
91317
|
+
return nok(code);
|
|
91318
|
+
effects.consume(code); // <<
|
|
91319
|
+
effects.exit('legacyVariableMarkerStart');
|
|
91320
|
+
effects.enter('legacyVariableValue');
|
|
91321
|
+
return value;
|
|
91322
|
+
};
|
|
91323
|
+
const value = (code) => {
|
|
91324
|
+
if (code === codes.greaterThan) {
|
|
91325
|
+
if (!hasValue)
|
|
91326
|
+
return nok(code);
|
|
91327
|
+
effects.exit('legacyVariableValue');
|
|
91328
|
+
effects.enter('legacyVariableMarkerEnd');
|
|
91329
|
+
effects.consume(code); // >
|
|
91330
|
+
return close2;
|
|
91331
|
+
}
|
|
91332
|
+
if (!isAllowedValueChar(code))
|
|
91333
|
+
return nok(code);
|
|
91334
|
+
hasValue = true;
|
|
91335
|
+
effects.consume(code);
|
|
91336
|
+
return value;
|
|
91337
|
+
};
|
|
91338
|
+
const close2 = (code) => {
|
|
91339
|
+
if (code !== codes.greaterThan)
|
|
91340
|
+
return nok(code);
|
|
91341
|
+
effects.consume(code); // >>
|
|
91342
|
+
effects.exit('legacyVariableMarkerEnd');
|
|
91343
|
+
effects.exit('legacyVariable');
|
|
91344
|
+
return ok;
|
|
91345
|
+
};
|
|
91346
|
+
return start;
|
|
91347
|
+
}
|
|
91348
|
+
function legacyVariable() {
|
|
91349
|
+
return {
|
|
91350
|
+
text: { [codes.lessThan]: legacyVariableConstruct },
|
|
91351
|
+
};
|
|
91352
|
+
}
|
|
91353
|
+
|
|
91354
|
+
;// ./lib/micromark/legacy-variable/index.ts
|
|
91355
|
+
/**
|
|
91356
|
+
* Micromark extension for <<variable>> / <<glossary:term>> inline syntax.
|
|
91357
|
+
*/
|
|
91358
|
+
|
|
91359
|
+
|
|
91040
91360
|
;// ./processor/transform/mdxish/mdxish-component-blocks.ts
|
|
91041
91361
|
|
|
91042
91362
|
|
|
91363
|
+
|
|
91364
|
+
|
|
91043
91365
|
const pascalCaseTagPattern = /^<([A-Z][A-Za-z0-9_]*)([^>]*?)(\/?)>([\s\S]*)?$/;
|
|
91044
91366
|
const tagAttributePattern = /([a-zA-Z_:][-a-zA-Z0-9_:.]*)(?:\s*=\s*("[^"]*"|'[^']*'|[^\s"'>]+))?/g;
|
|
91045
91367
|
/**
|
|
@@ -91056,7 +91378,10 @@ const MAX_LOOKAHEAD = 30;
|
|
|
91056
91378
|
* Glossary and Anchor are inline components.
|
|
91057
91379
|
*/
|
|
91058
91380
|
const EXCLUDED_TAGS = new Set(['HTMLBlock', 'Table', 'Glossary', 'Anchor']);
|
|
91059
|
-
const inlineMdProcessor = unified()
|
|
91381
|
+
const inlineMdProcessor = unified()
|
|
91382
|
+
.data('micromarkExtensions', [legacyVariable()])
|
|
91383
|
+
.data('fromMarkdownExtensions', [legacyVariableFromMarkdown()])
|
|
91384
|
+
.use(remarkParse);
|
|
91060
91385
|
const isClosingTag = (value, tag) => value.trim() === `</${tag}>`;
|
|
91061
91386
|
/**
|
|
91062
91387
|
* Parse markdown content into mdast children nodes.
|
|
@@ -92163,6 +92488,7 @@ const variables = ({ asMdx } = { asMdx: true }) => tree => {
|
|
|
92163
92488
|
const name = expression.expression.property.type === 'Identifier'
|
|
92164
92489
|
? expression.expression.property.name
|
|
92165
92490
|
: expression.expression.property.value;
|
|
92491
|
+
const position = 'position' in node ? node.position : undefined;
|
|
92166
92492
|
const variable = asMdx
|
|
92167
92493
|
? {
|
|
92168
92494
|
type: 'mdxJsxTextElement',
|
|
@@ -92175,7 +92501,7 @@ const variables = ({ asMdx } = { asMdx: true }) => tree => {
|
|
|
92175
92501
|
},
|
|
92176
92502
|
],
|
|
92177
92503
|
children: [],
|
|
92178
|
-
position
|
|
92504
|
+
position,
|
|
92179
92505
|
}
|
|
92180
92506
|
: {
|
|
92181
92507
|
type: NodeTypes.variable,
|
|
@@ -92186,7 +92512,7 @@ const variables = ({ asMdx } = { asMdx: true }) => tree => {
|
|
|
92186
92512
|
},
|
|
92187
92513
|
},
|
|
92188
92514
|
value: `{${node.value}}`,
|
|
92189
|
-
position
|
|
92515
|
+
position,
|
|
92190
92516
|
};
|
|
92191
92517
|
parent.children.splice(index, 1, variable);
|
|
92192
92518
|
});
|
|
@@ -114182,15 +114508,13 @@ function preprocessJSXExpressions(content, context = {}) {
|
|
|
114182
114508
|
let processed = protectHTMLBlockContent(content);
|
|
114183
114509
|
// Step 1: Protect code blocks and inline code
|
|
114184
114510
|
const { protectedCode, protectedContent } = protectCodeBlocks(processed);
|
|
114185
|
-
// Step 2:
|
|
114186
|
-
processed = removeJSXComments(protectedContent);
|
|
114187
|
-
// Step 3: Evaluate attribute expressions (JSX attribute syntax: href={baseUrl})
|
|
114511
|
+
// Step 2: Evaluate attribute expressions (JSX attribute syntax: href={baseUrl})
|
|
114188
114512
|
// For inline expressions, we use a library to parse the expression & evaluate it later
|
|
114189
114513
|
// For attribute expressions, it was difficult to use a library to parse them, so do it manually
|
|
114190
|
-
processed = evaluateAttributeExpressions(
|
|
114191
|
-
// Step
|
|
114514
|
+
processed = evaluateAttributeExpressions(protectedContent, context, protectedCode);
|
|
114515
|
+
// Step 3: Escape unbalanced braces to prevent MDX expression parsing errors
|
|
114192
114516
|
processed = escapeUnbalancedBraces(processed);
|
|
114193
|
-
// Step
|
|
114517
|
+
// Step 4: Restore protected code blocks
|
|
114194
114518
|
processed = restoreCodeBlocks(processed, protectedCode);
|
|
114195
114519
|
return processed;
|
|
114196
114520
|
}
|
|
@@ -114230,7 +114554,7 @@ const evaluateExpressions = ({ context = {} } = {}) => tree => {
|
|
|
114230
114554
|
parent.children.splice(index, 1, {
|
|
114231
114555
|
type: 'text',
|
|
114232
114556
|
value: textValue,
|
|
114233
|
-
position:
|
|
114557
|
+
position: expressionNode.position,
|
|
114234
114558
|
});
|
|
114235
114559
|
}
|
|
114236
114560
|
catch (_error) {
|
|
@@ -114241,7 +114565,7 @@ const evaluateExpressions = ({ context = {} } = {}) => tree => {
|
|
|
114241
114565
|
parent.children.splice(index, 1, {
|
|
114242
114566
|
type: 'text',
|
|
114243
114567
|
value: `{${processed}}`,
|
|
114244
|
-
position:
|
|
114568
|
+
position: expressionNode.position,
|
|
114245
114569
|
});
|
|
114246
114570
|
}
|
|
114247
114571
|
});
|
|
@@ -114249,6 +114573,43 @@ const evaluateExpressions = ({ context = {} } = {}) => tree => {
|
|
|
114249
114573
|
};
|
|
114250
114574
|
/* harmony default export */ const evaluate_expressions = (evaluateExpressions);
|
|
114251
114575
|
|
|
114576
|
+
;// ./processor/transform/mdxish/heading-slugs.ts
|
|
114577
|
+
|
|
114578
|
+
|
|
114579
|
+
function isHeading(node) {
|
|
114580
|
+
return /^h[1-6]$/.test(node.tagName);
|
|
114581
|
+
}
|
|
114582
|
+
function textContent(node) {
|
|
114583
|
+
if (node.type === 'text')
|
|
114584
|
+
return node.value;
|
|
114585
|
+
// Process variable nodes by using their variable name for the id generation
|
|
114586
|
+
if (node.type === 'element' && node.tagName === 'variable' && node.properties?.name) {
|
|
114587
|
+
if (node.properties.isLegacy) {
|
|
114588
|
+
return node.properties.name;
|
|
114589
|
+
}
|
|
114590
|
+
return `user.${node.properties.name}`;
|
|
114591
|
+
}
|
|
114592
|
+
if ('children' in node)
|
|
114593
|
+
return node.children.map(textContent).join('');
|
|
114594
|
+
return '';
|
|
114595
|
+
}
|
|
114596
|
+
/**
|
|
114597
|
+
* Rehype plugin that constructs ids for headings
|
|
114598
|
+
* Id's are used to construct slug anchor links & Table of Contents during rendering
|
|
114599
|
+
* Use the text / nodes that make up the heading to generate the id
|
|
114600
|
+
*/
|
|
114601
|
+
const generateSlugForHeadings = () => (tree) => {
|
|
114602
|
+
const slugger = new BananaSlug();
|
|
114603
|
+
visit(tree, 'element', (node) => {
|
|
114604
|
+
if (isHeading(node) && !node.properties.id) {
|
|
114605
|
+
const text = node.children.map(textContent).join('');
|
|
114606
|
+
node.properties.id = slugger.slug(text);
|
|
114607
|
+
}
|
|
114608
|
+
});
|
|
114609
|
+
return tree;
|
|
114610
|
+
};
|
|
114611
|
+
/* harmony default export */ const heading_slugs = (generateSlugForHeadings);
|
|
114612
|
+
|
|
114252
114613
|
;// ./node_modules/rehype-parse/lib/index.js
|
|
114253
114614
|
/**
|
|
114254
114615
|
* @import {Root} from 'hast'
|
|
@@ -114730,6 +115091,8 @@ const EMPTY_CODE_PLACEHOLDER = {
|
|
|
114730
115091
|
|
|
114731
115092
|
|
|
114732
115093
|
|
|
115094
|
+
|
|
115095
|
+
|
|
114733
115096
|
/**
|
|
114734
115097
|
* Wraps a node in a "pinned" container if sidebar: true is set.
|
|
114735
115098
|
*/
|
|
@@ -114768,9 +115131,17 @@ const preprocessBody = (text) => {
|
|
|
114768
115131
|
return ensureLeadingBreaks(text);
|
|
114769
115132
|
};
|
|
114770
115133
|
/** Markdown parser */
|
|
114771
|
-
const contentParser = unified()
|
|
115134
|
+
const contentParser = unified()
|
|
115135
|
+
.data('micromarkExtensions', [legacyVariable()])
|
|
115136
|
+
.data('fromMarkdownExtensions', [legacyVariableFromMarkdown()])
|
|
115137
|
+
.use(remarkParse)
|
|
115138
|
+
.use(remarkBreaks)
|
|
115139
|
+
.use(remarkGfm)
|
|
115140
|
+
.use(normalize_malformed_md_syntax);
|
|
114772
115141
|
/** Markdown to HTML processor (mdast → hast → HTML string) */
|
|
114773
115142
|
const markdownToHtml = unified()
|
|
115143
|
+
.data('micromarkExtensions', [legacyVariable()])
|
|
115144
|
+
.data('fromMarkdownExtensions', [legacyVariableFromMarkdown()])
|
|
114774
115145
|
.use(remarkParse)
|
|
114775
115146
|
.use(remarkGfm)
|
|
114776
115147
|
.use(normalize_malformed_md_syntax)
|
|
@@ -114883,7 +115254,13 @@ const parseTableCell = (text) => {
|
|
|
114883
115254
|
};
|
|
114884
115255
|
const parseBlock = (text) => {
|
|
114885
115256
|
if (!text.trim())
|
|
114886
|
-
return
|
|
115257
|
+
return textToBlock('');
|
|
115258
|
+
const tree = contentParser.runSync(contentParser.parse(text));
|
|
115259
|
+
return tree.children;
|
|
115260
|
+
};
|
|
115261
|
+
const parseInline = (text) => {
|
|
115262
|
+
if (!text.trim())
|
|
115263
|
+
return textToInline(text);
|
|
114887
115264
|
const tree = contentParser.runSync(contentParser.parse(text));
|
|
114888
115265
|
return tree.children;
|
|
114889
115266
|
};
|
|
@@ -114944,7 +115321,7 @@ function transformMagicBlock(blockType, data, rawValue, options = {}) {
|
|
|
114944
115321
|
const depth = headerJson.level || (compatibilityMode ? 1 : 2);
|
|
114945
115322
|
return [
|
|
114946
115323
|
wrapPinnedBlocks({
|
|
114947
|
-
children: 'title' in headerJson ?
|
|
115324
|
+
children: 'title' in headerJson ? parseInline(headerJson.title || '') : [],
|
|
114948
115325
|
depth,
|
|
114949
115326
|
type: 'heading',
|
|
114950
115327
|
}, data),
|
|
@@ -116104,6 +116481,72 @@ function terminateHtmlFlowBlocks(content) {
|
|
|
116104
116481
|
return restoreCodeBlocks(result.join('\n'), protectedCode);
|
|
116105
116482
|
}
|
|
116106
116483
|
|
|
116484
|
+
// EXTERNAL MODULE: ./node_modules/@readme/variable/dist/index.js
|
|
116485
|
+
var variable_dist = __webpack_require__(4355);
|
|
116486
|
+
var variable_dist_default = /*#__PURE__*/__webpack_require__.n(variable_dist);
|
|
116487
|
+
;// ./processor/transform/mdxish/variables-code.ts
|
|
116488
|
+
|
|
116489
|
+
|
|
116490
|
+
// Single combined regex so that resolved values from one pattern are never re-scanned by the other.
|
|
116491
|
+
const COMBINED_VARIABLE_REGEX = new RegExp(`${variable_dist.VARIABLE_REGEXP}|${variable_dist.MDX_VARIABLE_REGEXP}`, 'giu');
|
|
116492
|
+
// Flatten variables into a single object for easy lookup
|
|
116493
|
+
function variables_code_flattenVariables(variables) {
|
|
116494
|
+
if (!variables)
|
|
116495
|
+
return {};
|
|
116496
|
+
return {
|
|
116497
|
+
...Object.fromEntries((variables.defaults || []).map(d => [d.name, d.default])),
|
|
116498
|
+
...variables.user,
|
|
116499
|
+
};
|
|
116500
|
+
}
|
|
116501
|
+
function resolveCodeVariables(value, resolvedVariables) {
|
|
116502
|
+
return value.replace(COMBINED_VARIABLE_REGEX, (match, legacyName, mdxEscapePrefix, mdxVarName, mdxEscapeSuffix) => {
|
|
116503
|
+
// Legacy variable: <<...>>
|
|
116504
|
+
if (legacyName !== undefined) {
|
|
116505
|
+
if (match.startsWith('\\<<') || match.endsWith('\\>>'))
|
|
116506
|
+
return match;
|
|
116507
|
+
const name = legacyName.trim();
|
|
116508
|
+
if (name.startsWith('glossary:'))
|
|
116509
|
+
return name.toUpperCase();
|
|
116510
|
+
return name in resolvedVariables ? resolvedVariables[name] : name.toUpperCase();
|
|
116511
|
+
}
|
|
116512
|
+
// MDX variable: {user.*}
|
|
116513
|
+
if (mdxEscapePrefix || mdxEscapeSuffix)
|
|
116514
|
+
return match;
|
|
116515
|
+
if (mdxVarName in resolvedVariables)
|
|
116516
|
+
return resolvedVariables[mdxVarName];
|
|
116517
|
+
const fullPath = match.slice(1, -1);
|
|
116518
|
+
return fullPath.toUpperCase();
|
|
116519
|
+
});
|
|
116520
|
+
}
|
|
116521
|
+
/**
|
|
116522
|
+
* A remark mdast plugin that resolves legacy variables <<...>> and MDX variables {user.*} inside code and inline code nodes
|
|
116523
|
+
* to their values. Uses regexes from the readme variable to search for variables in the code string.
|
|
116524
|
+
*
|
|
116525
|
+
* This is needed because variables in code blocks and inline cannot be tokenized, and also we need to maintain the code string
|
|
116526
|
+
* in the code nodes. This enables engine side variable resolution in codes which improves UX
|
|
116527
|
+
*/
|
|
116528
|
+
const variablesCodeResolver = ({ variables } = {}) => tree => {
|
|
116529
|
+
const resolvedVariables = variables_code_flattenVariables(variables);
|
|
116530
|
+
visit(tree, 'inlineCode', (node) => {
|
|
116531
|
+
if (!node.value)
|
|
116532
|
+
return;
|
|
116533
|
+
node.value = resolveCodeVariables(node.value, resolvedVariables);
|
|
116534
|
+
});
|
|
116535
|
+
visit(tree, 'code', (node) => {
|
|
116536
|
+
if (!node.value)
|
|
116537
|
+
return;
|
|
116538
|
+
const nextValue = resolveCodeVariables(node.value, resolvedVariables);
|
|
116539
|
+
node.value = nextValue;
|
|
116540
|
+
// Keep code-tabs/readme-components hProperties in sync with node.value
|
|
116541
|
+
// because renderers read `value` from hProperties.
|
|
116542
|
+
if (node.data?.hProperties && typeof node.data.hProperties === 'object') {
|
|
116543
|
+
node.data.hProperties.value = nextValue;
|
|
116544
|
+
}
|
|
116545
|
+
});
|
|
116546
|
+
return tree;
|
|
116547
|
+
};
|
|
116548
|
+
/* harmony default export */ const variables_code = (variablesCodeResolver);
|
|
116549
|
+
|
|
116107
116550
|
;// ./processor/transform/mdxish/variables-text.ts
|
|
116108
116551
|
|
|
116109
116552
|
|
|
@@ -116117,13 +116560,38 @@ function terminateHtmlFlowBlocks(content) {
|
|
|
116117
116560
|
* Captures the field name in group 1 (dot notation) or group 2 (bracket notation)
|
|
116118
116561
|
*/
|
|
116119
116562
|
const USER_VAR_REGEX = /\{user\.(\w+)\}|\{user\[['"](\w+)['"]\]\}/g;
|
|
116563
|
+
function makeVariableNode(varName, rawValue) {
|
|
116564
|
+
return {
|
|
116565
|
+
type: NodeTypes.variable,
|
|
116566
|
+
data: {
|
|
116567
|
+
hName: 'Variable',
|
|
116568
|
+
hProperties: { name: varName },
|
|
116569
|
+
},
|
|
116570
|
+
value: rawValue,
|
|
116571
|
+
};
|
|
116572
|
+
}
|
|
116120
116573
|
/**
|
|
116121
|
-
* A remark plugin that parses {user.<field>} patterns from text nodes
|
|
116122
|
-
*
|
|
116574
|
+
* A remark plugin that parses {user.<field>} patterns from text nodes and
|
|
116575
|
+
* mdxTextExpression nodes, creating Variable nodes for runtime resolution.
|
|
116576
|
+
*
|
|
116577
|
+
* Handles both:
|
|
116578
|
+
* - `text` nodes: when safeMode is true or after expression evaluation
|
|
116579
|
+
* - `mdxTextExpression` nodes: when mdxExpression has parsed {user.*} before evaluation
|
|
116123
116580
|
*
|
|
116124
116581
|
* Supports any user field: name, email, email_verified, exp, iat, etc.
|
|
116125
116582
|
*/
|
|
116126
116583
|
const variablesTextTransformer = () => tree => {
|
|
116584
|
+
// Handle mdxTextExpression nodes (e.g. {user.name} parsed by mdxExpression)
|
|
116585
|
+
visit(tree, 'mdxTextExpression', (node, index, parent) => {
|
|
116586
|
+
if (index === undefined || !parent)
|
|
116587
|
+
return;
|
|
116588
|
+
const wrapped = `{${(node.value ?? '').trim()}}`; // Wrap the expression value in {} to match the USER_VAR_REGEX pattern
|
|
116589
|
+
const matches = [...wrapped.matchAll(USER_VAR_REGEX)];
|
|
116590
|
+
if (matches.length !== 1)
|
|
116591
|
+
return;
|
|
116592
|
+
const varName = matches[0][1] || matches[0][2];
|
|
116593
|
+
parent.children.splice(index, 1, makeVariableNode(varName, wrapped));
|
|
116594
|
+
});
|
|
116127
116595
|
visit(tree, 'text', (node, index, parent) => {
|
|
116128
116596
|
if (index === undefined || !parent)
|
|
116129
116597
|
return;
|
|
@@ -116148,15 +116616,7 @@ const variablesTextTransformer = () => tree => {
|
|
|
116148
116616
|
}
|
|
116149
116617
|
// Extract variable name from either capture group (dot or bracket notation)
|
|
116150
116618
|
const varName = match[1] || match[2];
|
|
116151
|
-
|
|
116152
|
-
parts.push({
|
|
116153
|
-
type: NodeTypes.variable,
|
|
116154
|
-
data: {
|
|
116155
|
-
hName: 'Variable',
|
|
116156
|
-
hProperties: { name: varName },
|
|
116157
|
-
},
|
|
116158
|
-
value: match[0],
|
|
116159
|
-
});
|
|
116619
|
+
parts.push(makeVariableNode(varName, match[0]));
|
|
116160
116620
|
lastIndex = matchIndex + match[0].length;
|
|
116161
116621
|
});
|
|
116162
116622
|
// Add remaining text after last match
|
|
@@ -116173,7 +116633,7 @@ const variablesTextTransformer = () => tree => {
|
|
|
116173
116633
|
/* harmony default export */ const variables_text = (variablesTextTransformer);
|
|
116174
116634
|
|
|
116175
116635
|
;// ./lib/mdast-util/magic-block/index.ts
|
|
116176
|
-
const
|
|
116636
|
+
const magic_block_contextMap = new WeakMap();
|
|
116177
116637
|
/**
|
|
116178
116638
|
* Find the magicBlock token in the token ancestry.
|
|
116179
116639
|
*/
|
|
@@ -116193,7 +116653,7 @@ function findMagicBlockToken() {
|
|
|
116193
116653
|
*/
|
|
116194
116654
|
function enterMagicBlock(token) {
|
|
116195
116655
|
// Initialize context for this magic block
|
|
116196
|
-
|
|
116656
|
+
magic_block_contextMap.set(token, { blockType: '', dataChunks: [] });
|
|
116197
116657
|
this.enter({
|
|
116198
116658
|
type: 'magicBlock',
|
|
116199
116659
|
blockType: '',
|
|
@@ -116208,7 +116668,7 @@ function exitMagicBlockType(token) {
|
|
|
116208
116668
|
const blockToken = findMagicBlockToken.call(this);
|
|
116209
116669
|
if (!blockToken)
|
|
116210
116670
|
return;
|
|
116211
|
-
const context =
|
|
116671
|
+
const context = magic_block_contextMap.get(blockToken);
|
|
116212
116672
|
if (context) {
|
|
116213
116673
|
context.blockType = this.sliceSerialize(token);
|
|
116214
116674
|
}
|
|
@@ -116220,7 +116680,7 @@ function exitMagicBlockData(token) {
|
|
|
116220
116680
|
const blockToken = findMagicBlockToken.call(this);
|
|
116221
116681
|
if (!blockToken)
|
|
116222
116682
|
return;
|
|
116223
|
-
const context =
|
|
116683
|
+
const context = magic_block_contextMap.get(blockToken);
|
|
116224
116684
|
if (context) {
|
|
116225
116685
|
context.dataChunks.push(this.sliceSerialize(token));
|
|
116226
116686
|
}
|
|
@@ -116232,7 +116692,7 @@ function exitMagicBlockLineEnding(token) {
|
|
|
116232
116692
|
const blockToken = findMagicBlockToken.call(this);
|
|
116233
116693
|
if (!blockToken)
|
|
116234
116694
|
return;
|
|
116235
|
-
const context =
|
|
116695
|
+
const context = magic_block_contextMap.get(blockToken);
|
|
116236
116696
|
if (context) {
|
|
116237
116697
|
context.dataChunks.push(this.sliceSerialize(token));
|
|
116238
116698
|
}
|
|
@@ -116250,7 +116710,7 @@ function exitMagicBlockMarkerEnd(token) {
|
|
|
116250
116710
|
// If this marker doesn't end with ']', it's a failed check and content belongs to data
|
|
116251
116711
|
// The successful end marker would be "[/block]"
|
|
116252
116712
|
if (!markerContent.endsWith(']') || markerContent !== '[/block]') {
|
|
116253
|
-
const context =
|
|
116713
|
+
const context = magic_block_contextMap.get(blockToken);
|
|
116254
116714
|
if (context) {
|
|
116255
116715
|
context.dataChunks.push(markerContent);
|
|
116256
116716
|
}
|
|
@@ -116260,7 +116720,7 @@ function exitMagicBlockMarkerEnd(token) {
|
|
|
116260
116720
|
* Exit handler: Finalize the magicBlock node with parsed JSON data.
|
|
116261
116721
|
*/
|
|
116262
116722
|
function exitMagicBlock(token) {
|
|
116263
|
-
const context =
|
|
116723
|
+
const context = magic_block_contextMap.get(token);
|
|
116264
116724
|
const node = this.stack[this.stack.length - 1];
|
|
116265
116725
|
if (context) {
|
|
116266
116726
|
const rawJson = context.dataChunks.join('');
|
|
@@ -116275,7 +116735,7 @@ function exitMagicBlock(token) {
|
|
|
116275
116735
|
node.data = {};
|
|
116276
116736
|
}
|
|
116277
116737
|
// Clean up context
|
|
116278
|
-
|
|
116738
|
+
magic_block_contextMap.delete(token);
|
|
116279
116739
|
}
|
|
116280
116740
|
this.exit(token);
|
|
116281
116741
|
}
|
|
@@ -116328,166 +116788,6 @@ function magicBlockToMarkdown() {
|
|
|
116328
116788
|
};
|
|
116329
116789
|
}
|
|
116330
116790
|
|
|
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
116791
|
;// ./lib/micromark/magic-block/syntax.ts
|
|
116492
116792
|
|
|
116493
116793
|
|
|
@@ -117406,6 +117706,10 @@ function loadComponents() {
|
|
|
117406
117706
|
|
|
117407
117707
|
|
|
117408
117708
|
|
|
117709
|
+
|
|
117710
|
+
|
|
117711
|
+
|
|
117712
|
+
|
|
117409
117713
|
|
|
117410
117714
|
|
|
117411
117715
|
|
|
@@ -117454,8 +117758,10 @@ function mdxishAstProcessor(mdContent, opts = {}) {
|
|
|
117454
117758
|
text: mdxExprExt.text,
|
|
117455
117759
|
};
|
|
117456
117760
|
const processor = unified()
|
|
117457
|
-
.data('micromarkExtensions', safeMode ? [magicBlock()] : [magicBlock(), mdxExprTextOnly])
|
|
117458
|
-
.data('fromMarkdownExtensions', safeMode
|
|
117761
|
+
.data('micromarkExtensions', safeMode ? [magicBlock(), legacyVariable()] : [magicBlock(), mdxExprTextOnly, legacyVariable()])
|
|
117762
|
+
.data('fromMarkdownExtensions', safeMode
|
|
117763
|
+
? [magicBlockFromMarkdown(), legacyVariableFromMarkdown()]
|
|
117764
|
+
: [magicBlockFromMarkdown(), mdxExpressionFromMarkdown(), legacyVariableFromMarkdown()])
|
|
117459
117765
|
.use(remarkParse)
|
|
117460
117766
|
.use(remarkFrontmatter)
|
|
117461
117767
|
.use(normalize_malformed_md_syntax)
|
|
@@ -117467,8 +117773,7 @@ function mdxishAstProcessor(mdContent, opts = {}) {
|
|
|
117467
117773
|
.use(mdxish_tables)
|
|
117468
117774
|
.use(mdxish_html_blocks)
|
|
117469
117775
|
.use(newEditorTypes ? mdxish_jsx_to_mdast : undefined) // Convert JSX elements to MDAST types
|
|
117470
|
-
.use(
|
|
117471
|
-
.use(variables_text) // Parse {user.*} patterns from text
|
|
117776
|
+
.use(variables_text) // Parse {user.*} patterns from text nodes
|
|
117472
117777
|
.use(useTailwind ? transform_tailwind : undefined, { components: tempComponentsMap })
|
|
117473
117778
|
.use(remarkGfm);
|
|
117474
117779
|
return {
|
|
@@ -117502,20 +117807,26 @@ function mdxishMdastToMd(mdast) {
|
|
|
117502
117807
|
* @see {@link https://github.com/readmeio/rmdx/blob/main/docs/mdxish-flow.md}
|
|
117503
117808
|
*/
|
|
117504
117809
|
function mdxish(mdContent, opts = {}) {
|
|
117505
|
-
const { components: userComponents = {} } = opts;
|
|
117810
|
+
const { components: userComponents = {}, jsxContext = {}, safeMode = false, variables } = opts;
|
|
117506
117811
|
const components = {
|
|
117507
117812
|
...loadComponents(),
|
|
117508
117813
|
...userComponents,
|
|
117509
117814
|
};
|
|
117510
|
-
|
|
117815
|
+
// Remove JSX comments before processing (protect code blocks first)
|
|
117816
|
+
const { protectedCode, protectedContent } = protectCodeBlocks(mdContent);
|
|
117817
|
+
const withoutComments = removeJSXComments(protectedContent);
|
|
117818
|
+
const contentWithoutComments = restoreCodeBlocks(withoutComments, protectedCode);
|
|
117819
|
+
const { processor, parserReadyContent } = mdxishAstProcessor(contentWithoutComments, opts);
|
|
117511
117820
|
processor
|
|
117821
|
+
.use(safeMode ? undefined : evaluate_expressions, { context: jsxContext }) // Evaluate MDX expressions using jsxContext
|
|
117512
117822
|
.use(remarkBreaks)
|
|
117823
|
+
.use(variables_code, { variables }) // Resolve <<...>> and {user.*} inside code and inline code nodes
|
|
117513
117824
|
.use(remarkRehype, { allowDangerousHtml: true, handlers: mdxComponentHandlers })
|
|
117514
117825
|
.use(preserveBooleanProperties) // RehypeRaw converts boolean properties to empty strings
|
|
117515
117826
|
.use(rehypeRaw, { passThrough: ['html-block'] })
|
|
117516
117827
|
.use(restoreBooleanProperties)
|
|
117517
117828
|
.use(mdxish_mermaid) // Add mermaid-render className to pre wrappers
|
|
117518
|
-
.use(
|
|
117829
|
+
.use(heading_slugs)
|
|
117519
117830
|
.use(rehypeMdxishComponents, {
|
|
117520
117831
|
components,
|
|
117521
117832
|
processMarkdown: (markdown) => mdxish(markdown, opts),
|
|
@@ -117655,9 +117966,6 @@ const migrate = (doc, opts) => {
|
|
|
117655
117966
|
};
|
|
117656
117967
|
/* harmony default export */ const lib_migrate = (migrate);
|
|
117657
117968
|
|
|
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
117969
|
// EXTERNAL MODULE: ./node_modules/rehype-react/index.js
|
|
117662
117970
|
var rehype_react = __webpack_require__(26);
|
|
117663
117971
|
var rehype_react_default = /*#__PURE__*/__webpack_require__.n(rehype_react);
|
|
@@ -118069,6 +118377,7 @@ function restoreMagicBlocks(replaced, blocks) {
|
|
|
118069
118377
|
|
|
118070
118378
|
|
|
118071
118379
|
|
|
118380
|
+
|
|
118072
118381
|
/**
|
|
118073
118382
|
* Removes Markdown and MDX comments.
|
|
118074
118383
|
*/
|
|
@@ -118089,6 +118398,7 @@ async function stripComments(doc, { mdx, mdxish } = {}) {
|
|
|
118089
118398
|
.use(normalize_malformed_md_syntax)
|
|
118090
118399
|
.use(mdx ? remarkMdx : undefined)
|
|
118091
118400
|
.use(stripCommentsTransformer)
|
|
118401
|
+
.use(remarkGfm)
|
|
118092
118402
|
.use(remarkStringify, mdx
|
|
118093
118403
|
? {}
|
|
118094
118404
|
: {
|