@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.js
CHANGED
|
@@ -12538,12 +12538,12 @@ var parseOptions = function parseOptions() {
|
|
|
12538
12538
|
return opts;
|
|
12539
12539
|
};
|
|
12540
12540
|
|
|
12541
|
-
;// ./node_modules/
|
|
12541
|
+
;// ./node_modules/github-slugger/regex.js
|
|
12542
12542
|
// This module is generated by `script/`.
|
|
12543
12543
|
/* eslint-disable no-control-regex, no-misleading-character-class, no-useless-escape */
|
|
12544
12544
|
const regex = /[\0-\x1F!-,\.\/:-@\[-\^`\{-\xA9\xAB-\xB4\xB6-\xB9\xBB-\xBF\xD7\xF7\u02C2-\u02C5\u02D2-\u02DF\u02E5-\u02EB\u02ED\u02EF-\u02FF\u0375\u0378\u0379\u037E\u0380-\u0385\u0387\u038B\u038D\u03A2\u03F6\u0482\u0530\u0557\u0558\u055A-\u055F\u0589-\u0590\u05BE\u05C0\u05C3\u05C6\u05C8-\u05CF\u05EB-\u05EE\u05F3-\u060F\u061B-\u061F\u066A-\u066D\u06D4\u06DD\u06DE\u06E9\u06FD\u06FE\u0700-\u070F\u074B\u074C\u07B2-\u07BF\u07F6-\u07F9\u07FB\u07FC\u07FE\u07FF\u082E-\u083F\u085C-\u085F\u086B-\u089F\u08B5\u08C8-\u08D2\u08E2\u0964\u0965\u0970\u0984\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
|
|
12545
12545
|
|
|
12546
|
-
;// ./node_modules/
|
|
12546
|
+
;// ./node_modules/github-slugger/index.js
|
|
12547
12547
|
|
|
12548
12548
|
|
|
12549
12549
|
const own = Object.hasOwnProperty
|
|
@@ -52928,6 +52928,12 @@ const stripCommentsTransformer = () => {
|
|
|
52928
52928
|
|
|
52929
52929
|
|
|
52930
52930
|
const STRIP_TAGS = ['script', 'style'];
|
|
52931
|
+
/** Valid JS identifier: starts with $, _, or a letter; followed by $, _, letters, digits, etc. */
|
|
52932
|
+
const JS_IDENTIFIER_RE = /^[$_\p{L}][$_\p{L}\p{Mn}\p{Mc}\p{Nd}\p{Pc}\u200C\u200D]*$/u;
|
|
52933
|
+
/** Format a variable key as MDX syntax, using bracket notation for non-identifier keys (e.g. hyphens). */
|
|
52934
|
+
function toMdxVariableSyntax(key) {
|
|
52935
|
+
return JS_IDENTIFIER_RE.test(key) ? `{user.${key}}` : `{user["${key}"]}`;
|
|
52936
|
+
}
|
|
52931
52937
|
/**
|
|
52932
52938
|
* Extract variable key from MDX expression AST (e.g., {user.name} → 'name')
|
|
52933
52939
|
* Uses ESTree AST inspection, matching the approach in processor/transform/variables.ts
|
|
@@ -52986,6 +52992,9 @@ function plain_one(node, opts) {
|
|
|
52986
52992
|
case 'variable':
|
|
52987
52993
|
case 'Variable': {
|
|
52988
52994
|
const key = node.properties.name.toString();
|
|
52995
|
+
if (opts.preserveVariableSyntax) {
|
|
52996
|
+
return node.properties.isLegacy ? `<<${key}>>` : toMdxVariableSyntax(key);
|
|
52997
|
+
}
|
|
52989
52998
|
const val = 'variables' in opts && opts.variables[key];
|
|
52990
52999
|
return val || key;
|
|
52991
53000
|
}
|
|
@@ -53009,6 +53018,8 @@ function plain_one(node, opts) {
|
|
|
53009
53018
|
if (node.type === 'mdxTextExpression') {
|
|
53010
53019
|
const key = extractMdxVariableKey(node);
|
|
53011
53020
|
if (key) {
|
|
53021
|
+
if (opts.preserveVariableSyntax)
|
|
53022
|
+
return toMdxVariableSyntax(key);
|
|
53012
53023
|
return ('variables' in opts && opts.variables[key]) || key;
|
|
53013
53024
|
}
|
|
53014
53025
|
}
|
|
@@ -70833,9 +70844,320 @@ const mdxToHast = () => tree => {
|
|
|
70833
70844
|
};
|
|
70834
70845
|
/* harmony default export */ const mdx_to_hast = (mdxToHast);
|
|
70835
70846
|
|
|
70847
|
+
;// ./lib/mdast-util/legacy-variable/index.ts
|
|
70848
|
+
|
|
70849
|
+
const contextMap = new WeakMap();
|
|
70850
|
+
function findlegacyVariableToken() {
|
|
70851
|
+
// tokenStack is micromark's current open token ancestry; find the nearest legacyVariable token.
|
|
70852
|
+
const events = this.tokenStack;
|
|
70853
|
+
for (let i = events.length - 1; i >= 0; i -= 1) {
|
|
70854
|
+
const token = events[i][0];
|
|
70855
|
+
if (token.type === 'legacyVariable')
|
|
70856
|
+
return token;
|
|
70857
|
+
}
|
|
70858
|
+
return undefined;
|
|
70859
|
+
}
|
|
70860
|
+
function enterlegacyVariable(token) {
|
|
70861
|
+
contextMap.set(token, { value: '' });
|
|
70862
|
+
}
|
|
70863
|
+
function exitlegacyVariableValue(token) {
|
|
70864
|
+
const variableToken = findlegacyVariableToken.call(this);
|
|
70865
|
+
if (!variableToken)
|
|
70866
|
+
return;
|
|
70867
|
+
const ctx = contextMap.get(variableToken);
|
|
70868
|
+
// Build up the variable characters
|
|
70869
|
+
if (ctx)
|
|
70870
|
+
ctx.value += this.sliceSerialize(token);
|
|
70871
|
+
}
|
|
70872
|
+
function exitlegacyVariable(token) {
|
|
70873
|
+
const ctx = contextMap.get(token);
|
|
70874
|
+
const serialized = this.sliceSerialize(token);
|
|
70875
|
+
const variableName = serialized.startsWith('<<') && serialized.endsWith('>>')
|
|
70876
|
+
? serialized.slice(2, -2)
|
|
70877
|
+
: ctx?.value ?? '';
|
|
70878
|
+
const nodePosition = {
|
|
70879
|
+
start: {
|
|
70880
|
+
offset: token.start.offset,
|
|
70881
|
+
line: token.start.line,
|
|
70882
|
+
column: token.start.column,
|
|
70883
|
+
},
|
|
70884
|
+
end: {
|
|
70885
|
+
offset: token.end.offset,
|
|
70886
|
+
line: token.end.line,
|
|
70887
|
+
column: token.end.column,
|
|
70888
|
+
},
|
|
70889
|
+
};
|
|
70890
|
+
if (variableName.startsWith('glossary:')) {
|
|
70891
|
+
const term = variableName.slice('glossary:'.length).trim();
|
|
70892
|
+
this.enter({
|
|
70893
|
+
type: NodeTypes.glossary,
|
|
70894
|
+
data: {
|
|
70895
|
+
hName: 'Glossary',
|
|
70896
|
+
hProperties: { term },
|
|
70897
|
+
},
|
|
70898
|
+
children: [{ type: 'text', value: term }],
|
|
70899
|
+
position: nodePosition,
|
|
70900
|
+
}, token);
|
|
70901
|
+
this.exit(token);
|
|
70902
|
+
contextMap.delete(token);
|
|
70903
|
+
return;
|
|
70904
|
+
}
|
|
70905
|
+
this.enter({
|
|
70906
|
+
type: NodeTypes.variable,
|
|
70907
|
+
data: {
|
|
70908
|
+
hName: 'Variable',
|
|
70909
|
+
hProperties: { name: variableName.trim(), isLegacy: true },
|
|
70910
|
+
},
|
|
70911
|
+
value: `<<${variableName}>>`,
|
|
70912
|
+
}, token);
|
|
70913
|
+
this.exit(token);
|
|
70914
|
+
contextMap.delete(token);
|
|
70915
|
+
}
|
|
70916
|
+
function legacyVariableFromMarkdown() {
|
|
70917
|
+
return {
|
|
70918
|
+
enter: {
|
|
70919
|
+
legacyVariable: enterlegacyVariable,
|
|
70920
|
+
},
|
|
70921
|
+
exit: {
|
|
70922
|
+
legacyVariableValue: exitlegacyVariableValue,
|
|
70923
|
+
legacyVariable: exitlegacyVariable,
|
|
70924
|
+
},
|
|
70925
|
+
};
|
|
70926
|
+
}
|
|
70927
|
+
|
|
70928
|
+
;// ./node_modules/micromark-util-symbol/lib/codes.js
|
|
70929
|
+
/**
|
|
70930
|
+
* Character codes.
|
|
70931
|
+
*
|
|
70932
|
+
* This module is compiled away!
|
|
70933
|
+
*
|
|
70934
|
+
* micromark works based on character codes.
|
|
70935
|
+
* This module contains constants for the ASCII block and the replacement
|
|
70936
|
+
* character.
|
|
70937
|
+
* A couple of them are handled in a special way, such as the line endings
|
|
70938
|
+
* (CR, LF, and CR+LF, commonly known as end-of-line: EOLs), the tab (horizontal
|
|
70939
|
+
* tab) and its expansion based on what column it’s at (virtual space),
|
|
70940
|
+
* and the end-of-file (eof) character.
|
|
70941
|
+
* As values are preprocessed before handling them, the actual characters LF,
|
|
70942
|
+
* CR, HT, and NUL (which is present as the replacement character), are
|
|
70943
|
+
* guaranteed to not exist.
|
|
70944
|
+
*
|
|
70945
|
+
* Unicode basic latin block.
|
|
70946
|
+
*/
|
|
70947
|
+
const codes = /** @type {const} */ ({
|
|
70948
|
+
carriageReturn: -5,
|
|
70949
|
+
lineFeed: -4,
|
|
70950
|
+
carriageReturnLineFeed: -3,
|
|
70951
|
+
horizontalTab: -2,
|
|
70952
|
+
virtualSpace: -1,
|
|
70953
|
+
eof: null,
|
|
70954
|
+
nul: 0,
|
|
70955
|
+
soh: 1,
|
|
70956
|
+
stx: 2,
|
|
70957
|
+
etx: 3,
|
|
70958
|
+
eot: 4,
|
|
70959
|
+
enq: 5,
|
|
70960
|
+
ack: 6,
|
|
70961
|
+
bel: 7,
|
|
70962
|
+
bs: 8,
|
|
70963
|
+
ht: 9, // `\t`
|
|
70964
|
+
lf: 10, // `\n`
|
|
70965
|
+
vt: 11, // `\v`
|
|
70966
|
+
ff: 12, // `\f`
|
|
70967
|
+
cr: 13, // `\r`
|
|
70968
|
+
so: 14,
|
|
70969
|
+
si: 15,
|
|
70970
|
+
dle: 16,
|
|
70971
|
+
dc1: 17,
|
|
70972
|
+
dc2: 18,
|
|
70973
|
+
dc3: 19,
|
|
70974
|
+
dc4: 20,
|
|
70975
|
+
nak: 21,
|
|
70976
|
+
syn: 22,
|
|
70977
|
+
etb: 23,
|
|
70978
|
+
can: 24,
|
|
70979
|
+
em: 25,
|
|
70980
|
+
sub: 26,
|
|
70981
|
+
esc: 27,
|
|
70982
|
+
fs: 28,
|
|
70983
|
+
gs: 29,
|
|
70984
|
+
rs: 30,
|
|
70985
|
+
us: 31,
|
|
70986
|
+
space: 32,
|
|
70987
|
+
exclamationMark: 33, // `!`
|
|
70988
|
+
quotationMark: 34, // `"`
|
|
70989
|
+
numberSign: 35, // `#`
|
|
70990
|
+
dollarSign: 36, // `$`
|
|
70991
|
+
percentSign: 37, // `%`
|
|
70992
|
+
ampersand: 38, // `&`
|
|
70993
|
+
apostrophe: 39, // `'`
|
|
70994
|
+
leftParenthesis: 40, // `(`
|
|
70995
|
+
rightParenthesis: 41, // `)`
|
|
70996
|
+
asterisk: 42, // `*`
|
|
70997
|
+
plusSign: 43, // `+`
|
|
70998
|
+
comma: 44, // `,`
|
|
70999
|
+
dash: 45, // `-`
|
|
71000
|
+
dot: 46, // `.`
|
|
71001
|
+
slash: 47, // `/`
|
|
71002
|
+
digit0: 48, // `0`
|
|
71003
|
+
digit1: 49, // `1`
|
|
71004
|
+
digit2: 50, // `2`
|
|
71005
|
+
digit3: 51, // `3`
|
|
71006
|
+
digit4: 52, // `4`
|
|
71007
|
+
digit5: 53, // `5`
|
|
71008
|
+
digit6: 54, // `6`
|
|
71009
|
+
digit7: 55, // `7`
|
|
71010
|
+
digit8: 56, // `8`
|
|
71011
|
+
digit9: 57, // `9`
|
|
71012
|
+
colon: 58, // `:`
|
|
71013
|
+
semicolon: 59, // `;`
|
|
71014
|
+
lessThan: 60, // `<`
|
|
71015
|
+
equalsTo: 61, // `=`
|
|
71016
|
+
greaterThan: 62, // `>`
|
|
71017
|
+
questionMark: 63, // `?`
|
|
71018
|
+
atSign: 64, // `@`
|
|
71019
|
+
uppercaseA: 65, // `A`
|
|
71020
|
+
uppercaseB: 66, // `B`
|
|
71021
|
+
uppercaseC: 67, // `C`
|
|
71022
|
+
uppercaseD: 68, // `D`
|
|
71023
|
+
uppercaseE: 69, // `E`
|
|
71024
|
+
uppercaseF: 70, // `F`
|
|
71025
|
+
uppercaseG: 71, // `G`
|
|
71026
|
+
uppercaseH: 72, // `H`
|
|
71027
|
+
uppercaseI: 73, // `I`
|
|
71028
|
+
uppercaseJ: 74, // `J`
|
|
71029
|
+
uppercaseK: 75, // `K`
|
|
71030
|
+
uppercaseL: 76, // `L`
|
|
71031
|
+
uppercaseM: 77, // `M`
|
|
71032
|
+
uppercaseN: 78, // `N`
|
|
71033
|
+
uppercaseO: 79, // `O`
|
|
71034
|
+
uppercaseP: 80, // `P`
|
|
71035
|
+
uppercaseQ: 81, // `Q`
|
|
71036
|
+
uppercaseR: 82, // `R`
|
|
71037
|
+
uppercaseS: 83, // `S`
|
|
71038
|
+
uppercaseT: 84, // `T`
|
|
71039
|
+
uppercaseU: 85, // `U`
|
|
71040
|
+
uppercaseV: 86, // `V`
|
|
71041
|
+
uppercaseW: 87, // `W`
|
|
71042
|
+
uppercaseX: 88, // `X`
|
|
71043
|
+
uppercaseY: 89, // `Y`
|
|
71044
|
+
uppercaseZ: 90, // `Z`
|
|
71045
|
+
leftSquareBracket: 91, // `[`
|
|
71046
|
+
backslash: 92, // `\`
|
|
71047
|
+
rightSquareBracket: 93, // `]`
|
|
71048
|
+
caret: 94, // `^`
|
|
71049
|
+
underscore: 95, // `_`
|
|
71050
|
+
graveAccent: 96, // `` ` ``
|
|
71051
|
+
lowercaseA: 97, // `a`
|
|
71052
|
+
lowercaseB: 98, // `b`
|
|
71053
|
+
lowercaseC: 99, // `c`
|
|
71054
|
+
lowercaseD: 100, // `d`
|
|
71055
|
+
lowercaseE: 101, // `e`
|
|
71056
|
+
lowercaseF: 102, // `f`
|
|
71057
|
+
lowercaseG: 103, // `g`
|
|
71058
|
+
lowercaseH: 104, // `h`
|
|
71059
|
+
lowercaseI: 105, // `i`
|
|
71060
|
+
lowercaseJ: 106, // `j`
|
|
71061
|
+
lowercaseK: 107, // `k`
|
|
71062
|
+
lowercaseL: 108, // `l`
|
|
71063
|
+
lowercaseM: 109, // `m`
|
|
71064
|
+
lowercaseN: 110, // `n`
|
|
71065
|
+
lowercaseO: 111, // `o`
|
|
71066
|
+
lowercaseP: 112, // `p`
|
|
71067
|
+
lowercaseQ: 113, // `q`
|
|
71068
|
+
lowercaseR: 114, // `r`
|
|
71069
|
+
lowercaseS: 115, // `s`
|
|
71070
|
+
lowercaseT: 116, // `t`
|
|
71071
|
+
lowercaseU: 117, // `u`
|
|
71072
|
+
lowercaseV: 118, // `v`
|
|
71073
|
+
lowercaseW: 119, // `w`
|
|
71074
|
+
lowercaseX: 120, // `x`
|
|
71075
|
+
lowercaseY: 121, // `y`
|
|
71076
|
+
lowercaseZ: 122, // `z`
|
|
71077
|
+
leftCurlyBrace: 123, // `{`
|
|
71078
|
+
verticalBar: 124, // `|`
|
|
71079
|
+
rightCurlyBrace: 125, // `}`
|
|
71080
|
+
tilde: 126, // `~`
|
|
71081
|
+
del: 127,
|
|
71082
|
+
// Unicode Specials block.
|
|
71083
|
+
byteOrderMarker: 65_279,
|
|
71084
|
+
// Unicode Specials block.
|
|
71085
|
+
replacementCharacter: 65_533 // `�`
|
|
71086
|
+
})
|
|
71087
|
+
|
|
71088
|
+
;// ./lib/micromark/legacy-variable/syntax.ts
|
|
71089
|
+
|
|
71090
|
+
|
|
71091
|
+
function isAllowedValueChar(code) {
|
|
71092
|
+
return (code !== null &&
|
|
71093
|
+
code !== codes.lessThan &&
|
|
71094
|
+
code !== codes.greaterThan &&
|
|
71095
|
+
!markdownLineEnding(code));
|
|
71096
|
+
}
|
|
71097
|
+
const legacyVariableConstruct = {
|
|
71098
|
+
name: 'legacyVariable',
|
|
71099
|
+
tokenize,
|
|
71100
|
+
};
|
|
71101
|
+
function tokenize(effects, ok, nok) {
|
|
71102
|
+
let hasValue = false;
|
|
71103
|
+
const start = (code) => {
|
|
71104
|
+
if (code !== codes.lessThan)
|
|
71105
|
+
return nok(code);
|
|
71106
|
+
effects.enter('legacyVariable');
|
|
71107
|
+
effects.enter('legacyVariableMarkerStart');
|
|
71108
|
+
effects.consume(code); // <
|
|
71109
|
+
return open2;
|
|
71110
|
+
};
|
|
71111
|
+
const open2 = (code) => {
|
|
71112
|
+
if (code !== codes.lessThan)
|
|
71113
|
+
return nok(code);
|
|
71114
|
+
effects.consume(code); // <<
|
|
71115
|
+
effects.exit('legacyVariableMarkerStart');
|
|
71116
|
+
effects.enter('legacyVariableValue');
|
|
71117
|
+
return value;
|
|
71118
|
+
};
|
|
71119
|
+
const value = (code) => {
|
|
71120
|
+
if (code === codes.greaterThan) {
|
|
71121
|
+
if (!hasValue)
|
|
71122
|
+
return nok(code);
|
|
71123
|
+
effects.exit('legacyVariableValue');
|
|
71124
|
+
effects.enter('legacyVariableMarkerEnd');
|
|
71125
|
+
effects.consume(code); // >
|
|
71126
|
+
return close2;
|
|
71127
|
+
}
|
|
71128
|
+
if (!isAllowedValueChar(code))
|
|
71129
|
+
return nok(code);
|
|
71130
|
+
hasValue = true;
|
|
71131
|
+
effects.consume(code);
|
|
71132
|
+
return value;
|
|
71133
|
+
};
|
|
71134
|
+
const close2 = (code) => {
|
|
71135
|
+
if (code !== codes.greaterThan)
|
|
71136
|
+
return nok(code);
|
|
71137
|
+
effects.consume(code); // >>
|
|
71138
|
+
effects.exit('legacyVariableMarkerEnd');
|
|
71139
|
+
effects.exit('legacyVariable');
|
|
71140
|
+
return ok;
|
|
71141
|
+
};
|
|
71142
|
+
return start;
|
|
71143
|
+
}
|
|
71144
|
+
function legacyVariable() {
|
|
71145
|
+
return {
|
|
71146
|
+
text: { [codes.lessThan]: legacyVariableConstruct },
|
|
71147
|
+
};
|
|
71148
|
+
}
|
|
71149
|
+
|
|
71150
|
+
;// ./lib/micromark/legacy-variable/index.ts
|
|
71151
|
+
/**
|
|
71152
|
+
* Micromark extension for <<variable>> / <<glossary:term>> inline syntax.
|
|
71153
|
+
*/
|
|
71154
|
+
|
|
71155
|
+
|
|
70836
71156
|
;// ./processor/transform/mdxish/mdxish-component-blocks.ts
|
|
70837
71157
|
|
|
70838
71158
|
|
|
71159
|
+
|
|
71160
|
+
|
|
70839
71161
|
const pascalCaseTagPattern = /^<([A-Z][A-Za-z0-9_]*)([^>]*?)(\/?)>([\s\S]*)?$/;
|
|
70840
71162
|
const tagAttributePattern = /([a-zA-Z_:][-a-zA-Z0-9_:.]*)(?:\s*=\s*("[^"]*"|'[^']*'|[^\s"'>]+))?/g;
|
|
70841
71163
|
/**
|
|
@@ -70852,7 +71174,10 @@ const MAX_LOOKAHEAD = 30;
|
|
|
70852
71174
|
* Glossary and Anchor are inline components.
|
|
70853
71175
|
*/
|
|
70854
71176
|
const EXCLUDED_TAGS = new Set(['HTMLBlock', 'Table', 'Glossary', 'Anchor']);
|
|
70855
|
-
const inlineMdProcessor = unified()
|
|
71177
|
+
const inlineMdProcessor = unified()
|
|
71178
|
+
.data('micromarkExtensions', [legacyVariable()])
|
|
71179
|
+
.data('fromMarkdownExtensions', [legacyVariableFromMarkdown()])
|
|
71180
|
+
.use(remarkParse);
|
|
70856
71181
|
const isClosingTag = (value, tag) => value.trim() === `</${tag}>`;
|
|
70857
71182
|
/**
|
|
70858
71183
|
* Parse markdown content into mdast children nodes.
|
|
@@ -71959,6 +72284,7 @@ const variables = ({ asMdx } = { asMdx: true }) => tree => {
|
|
|
71959
72284
|
const name = expression.expression.property.type === 'Identifier'
|
|
71960
72285
|
? expression.expression.property.name
|
|
71961
72286
|
: expression.expression.property.value;
|
|
72287
|
+
const position = 'position' in node ? node.position : undefined;
|
|
71962
72288
|
const variable = asMdx
|
|
71963
72289
|
? {
|
|
71964
72290
|
type: 'mdxJsxTextElement',
|
|
@@ -71971,7 +72297,7 @@ const variables = ({ asMdx } = { asMdx: true }) => tree => {
|
|
|
71971
72297
|
},
|
|
71972
72298
|
],
|
|
71973
72299
|
children: [],
|
|
71974
|
-
position
|
|
72300
|
+
position,
|
|
71975
72301
|
}
|
|
71976
72302
|
: {
|
|
71977
72303
|
type: NodeTypes.variable,
|
|
@@ -71982,7 +72308,7 @@ const variables = ({ asMdx } = { asMdx: true }) => tree => {
|
|
|
71982
72308
|
},
|
|
71983
72309
|
},
|
|
71984
72310
|
value: `{${node.value}}`,
|
|
71985
|
-
position
|
|
72311
|
+
position,
|
|
71986
72312
|
};
|
|
71987
72313
|
parent.children.splice(index, 1, variable);
|
|
71988
72314
|
});
|
|
@@ -93978,15 +94304,13 @@ function preprocessJSXExpressions(content, context = {}) {
|
|
|
93978
94304
|
let processed = protectHTMLBlockContent(content);
|
|
93979
94305
|
// Step 1: Protect code blocks and inline code
|
|
93980
94306
|
const { protectedCode, protectedContent } = protectCodeBlocks(processed);
|
|
93981
|
-
// Step 2:
|
|
93982
|
-
processed = removeJSXComments(protectedContent);
|
|
93983
|
-
// Step 3: Evaluate attribute expressions (JSX attribute syntax: href={baseUrl})
|
|
94307
|
+
// Step 2: Evaluate attribute expressions (JSX attribute syntax: href={baseUrl})
|
|
93984
94308
|
// For inline expressions, we use a library to parse the expression & evaluate it later
|
|
93985
94309
|
// For attribute expressions, it was difficult to use a library to parse them, so do it manually
|
|
93986
|
-
processed = evaluateAttributeExpressions(
|
|
93987
|
-
// Step
|
|
94310
|
+
processed = evaluateAttributeExpressions(protectedContent, context, protectedCode);
|
|
94311
|
+
// Step 3: Escape unbalanced braces to prevent MDX expression parsing errors
|
|
93988
94312
|
processed = escapeUnbalancedBraces(processed);
|
|
93989
|
-
// Step
|
|
94313
|
+
// Step 4: Restore protected code blocks
|
|
93990
94314
|
processed = restoreCodeBlocks(processed, protectedCode);
|
|
93991
94315
|
return processed;
|
|
93992
94316
|
}
|
|
@@ -94026,7 +94350,7 @@ const evaluateExpressions = ({ context = {} } = {}) => tree => {
|
|
|
94026
94350
|
parent.children.splice(index, 1, {
|
|
94027
94351
|
type: 'text',
|
|
94028
94352
|
value: textValue,
|
|
94029
|
-
position:
|
|
94353
|
+
position: expressionNode.position,
|
|
94030
94354
|
});
|
|
94031
94355
|
}
|
|
94032
94356
|
catch (_error) {
|
|
@@ -94037,7 +94361,7 @@ const evaluateExpressions = ({ context = {} } = {}) => tree => {
|
|
|
94037
94361
|
parent.children.splice(index, 1, {
|
|
94038
94362
|
type: 'text',
|
|
94039
94363
|
value: `{${processed}}`,
|
|
94040
|
-
position:
|
|
94364
|
+
position: expressionNode.position,
|
|
94041
94365
|
});
|
|
94042
94366
|
}
|
|
94043
94367
|
});
|
|
@@ -94045,6 +94369,43 @@ const evaluateExpressions = ({ context = {} } = {}) => tree => {
|
|
|
94045
94369
|
};
|
|
94046
94370
|
/* harmony default export */ const evaluate_expressions = (evaluateExpressions);
|
|
94047
94371
|
|
|
94372
|
+
;// ./processor/transform/mdxish/heading-slugs.ts
|
|
94373
|
+
|
|
94374
|
+
|
|
94375
|
+
function isHeading(node) {
|
|
94376
|
+
return /^h[1-6]$/.test(node.tagName);
|
|
94377
|
+
}
|
|
94378
|
+
function textContent(node) {
|
|
94379
|
+
if (node.type === 'text')
|
|
94380
|
+
return node.value;
|
|
94381
|
+
// Process variable nodes by using their variable name for the id generation
|
|
94382
|
+
if (node.type === 'element' && node.tagName === 'variable' && node.properties?.name) {
|
|
94383
|
+
if (node.properties.isLegacy) {
|
|
94384
|
+
return node.properties.name;
|
|
94385
|
+
}
|
|
94386
|
+
return `user.${node.properties.name}`;
|
|
94387
|
+
}
|
|
94388
|
+
if ('children' in node)
|
|
94389
|
+
return node.children.map(textContent).join('');
|
|
94390
|
+
return '';
|
|
94391
|
+
}
|
|
94392
|
+
/**
|
|
94393
|
+
* Rehype plugin that constructs ids for headings
|
|
94394
|
+
* Id's are used to construct slug anchor links & Table of Contents during rendering
|
|
94395
|
+
* Use the text / nodes that make up the heading to generate the id
|
|
94396
|
+
*/
|
|
94397
|
+
const generateSlugForHeadings = () => (tree) => {
|
|
94398
|
+
const slugger = new BananaSlug();
|
|
94399
|
+
visit(tree, 'element', (node) => {
|
|
94400
|
+
if (isHeading(node) && !node.properties.id) {
|
|
94401
|
+
const text = node.children.map(textContent).join('');
|
|
94402
|
+
node.properties.id = slugger.slug(text);
|
|
94403
|
+
}
|
|
94404
|
+
});
|
|
94405
|
+
return tree;
|
|
94406
|
+
};
|
|
94407
|
+
/* harmony default export */ const heading_slugs = (generateSlugForHeadings);
|
|
94408
|
+
|
|
94048
94409
|
;// ./node_modules/rehype-parse/lib/index.js
|
|
94049
94410
|
/**
|
|
94050
94411
|
* @import {Root} from 'hast'
|
|
@@ -94526,6 +94887,8 @@ const EMPTY_CODE_PLACEHOLDER = {
|
|
|
94526
94887
|
|
|
94527
94888
|
|
|
94528
94889
|
|
|
94890
|
+
|
|
94891
|
+
|
|
94529
94892
|
/**
|
|
94530
94893
|
* Wraps a node in a "pinned" container if sidebar: true is set.
|
|
94531
94894
|
*/
|
|
@@ -94564,9 +94927,17 @@ const preprocessBody = (text) => {
|
|
|
94564
94927
|
return ensureLeadingBreaks(text);
|
|
94565
94928
|
};
|
|
94566
94929
|
/** Markdown parser */
|
|
94567
|
-
const contentParser = unified()
|
|
94930
|
+
const contentParser = unified()
|
|
94931
|
+
.data('micromarkExtensions', [legacyVariable()])
|
|
94932
|
+
.data('fromMarkdownExtensions', [legacyVariableFromMarkdown()])
|
|
94933
|
+
.use(remarkParse)
|
|
94934
|
+
.use(remarkBreaks)
|
|
94935
|
+
.use(remarkGfm)
|
|
94936
|
+
.use(normalize_malformed_md_syntax);
|
|
94568
94937
|
/** Markdown to HTML processor (mdast → hast → HTML string) */
|
|
94569
94938
|
const markdownToHtml = unified()
|
|
94939
|
+
.data('micromarkExtensions', [legacyVariable()])
|
|
94940
|
+
.data('fromMarkdownExtensions', [legacyVariableFromMarkdown()])
|
|
94570
94941
|
.use(remarkParse)
|
|
94571
94942
|
.use(remarkGfm)
|
|
94572
94943
|
.use(normalize_malformed_md_syntax)
|
|
@@ -94679,7 +95050,13 @@ const parseTableCell = (text) => {
|
|
|
94679
95050
|
};
|
|
94680
95051
|
const parseBlock = (text) => {
|
|
94681
95052
|
if (!text.trim())
|
|
94682
|
-
return
|
|
95053
|
+
return textToBlock('');
|
|
95054
|
+
const tree = contentParser.runSync(contentParser.parse(text));
|
|
95055
|
+
return tree.children;
|
|
95056
|
+
};
|
|
95057
|
+
const parseInline = (text) => {
|
|
95058
|
+
if (!text.trim())
|
|
95059
|
+
return textToInline(text);
|
|
94683
95060
|
const tree = contentParser.runSync(contentParser.parse(text));
|
|
94684
95061
|
return tree.children;
|
|
94685
95062
|
};
|
|
@@ -94740,7 +95117,7 @@ function transformMagicBlock(blockType, data, rawValue, options = {}) {
|
|
|
94740
95117
|
const depth = headerJson.level || (compatibilityMode ? 1 : 2);
|
|
94741
95118
|
return [
|
|
94742
95119
|
wrapPinnedBlocks({
|
|
94743
|
-
children: 'title' in headerJson ?
|
|
95120
|
+
children: 'title' in headerJson ? parseInline(headerJson.title || '') : [],
|
|
94744
95121
|
depth,
|
|
94745
95122
|
type: 'heading',
|
|
94746
95123
|
}, data),
|
|
@@ -95900,6 +96277,72 @@ function terminateHtmlFlowBlocks(content) {
|
|
|
95900
96277
|
return restoreCodeBlocks(result.join('\n'), protectedCode);
|
|
95901
96278
|
}
|
|
95902
96279
|
|
|
96280
|
+
// EXTERNAL MODULE: external "@readme/variable"
|
|
96281
|
+
var variable_ = __webpack_require__(8167);
|
|
96282
|
+
var variable_default = /*#__PURE__*/__webpack_require__.n(variable_);
|
|
96283
|
+
;// ./processor/transform/mdxish/variables-code.ts
|
|
96284
|
+
|
|
96285
|
+
|
|
96286
|
+
// Single combined regex so that resolved values from one pattern are never re-scanned by the other.
|
|
96287
|
+
const COMBINED_VARIABLE_REGEX = new RegExp(`${variable_.VARIABLE_REGEXP}|${variable_.MDX_VARIABLE_REGEXP}`, 'giu');
|
|
96288
|
+
// Flatten variables into a single object for easy lookup
|
|
96289
|
+
function variables_code_flattenVariables(variables) {
|
|
96290
|
+
if (!variables)
|
|
96291
|
+
return {};
|
|
96292
|
+
return {
|
|
96293
|
+
...Object.fromEntries((variables.defaults || []).map(d => [d.name, d.default])),
|
|
96294
|
+
...variables.user,
|
|
96295
|
+
};
|
|
96296
|
+
}
|
|
96297
|
+
function resolveCodeVariables(value, resolvedVariables) {
|
|
96298
|
+
return value.replace(COMBINED_VARIABLE_REGEX, (match, legacyName, mdxEscapePrefix, mdxVarName, mdxEscapeSuffix) => {
|
|
96299
|
+
// Legacy variable: <<...>>
|
|
96300
|
+
if (legacyName !== undefined) {
|
|
96301
|
+
if (match.startsWith('\\<<') || match.endsWith('\\>>'))
|
|
96302
|
+
return match;
|
|
96303
|
+
const name = legacyName.trim();
|
|
96304
|
+
if (name.startsWith('glossary:'))
|
|
96305
|
+
return name.toUpperCase();
|
|
96306
|
+
return name in resolvedVariables ? resolvedVariables[name] : name.toUpperCase();
|
|
96307
|
+
}
|
|
96308
|
+
// MDX variable: {user.*}
|
|
96309
|
+
if (mdxEscapePrefix || mdxEscapeSuffix)
|
|
96310
|
+
return match;
|
|
96311
|
+
if (mdxVarName in resolvedVariables)
|
|
96312
|
+
return resolvedVariables[mdxVarName];
|
|
96313
|
+
const fullPath = match.slice(1, -1);
|
|
96314
|
+
return fullPath.toUpperCase();
|
|
96315
|
+
});
|
|
96316
|
+
}
|
|
96317
|
+
/**
|
|
96318
|
+
* A remark mdast plugin that resolves legacy variables <<...>> and MDX variables {user.*} inside code and inline code nodes
|
|
96319
|
+
* to their values. Uses regexes from the readme variable to search for variables in the code string.
|
|
96320
|
+
*
|
|
96321
|
+
* This is needed because variables in code blocks and inline cannot be tokenized, and also we need to maintain the code string
|
|
96322
|
+
* in the code nodes. This enables engine side variable resolution in codes which improves UX
|
|
96323
|
+
*/
|
|
96324
|
+
const variablesCodeResolver = ({ variables } = {}) => tree => {
|
|
96325
|
+
const resolvedVariables = variables_code_flattenVariables(variables);
|
|
96326
|
+
visit(tree, 'inlineCode', (node) => {
|
|
96327
|
+
if (!node.value)
|
|
96328
|
+
return;
|
|
96329
|
+
node.value = resolveCodeVariables(node.value, resolvedVariables);
|
|
96330
|
+
});
|
|
96331
|
+
visit(tree, 'code', (node) => {
|
|
96332
|
+
if (!node.value)
|
|
96333
|
+
return;
|
|
96334
|
+
const nextValue = resolveCodeVariables(node.value, resolvedVariables);
|
|
96335
|
+
node.value = nextValue;
|
|
96336
|
+
// Keep code-tabs/readme-components hProperties in sync with node.value
|
|
96337
|
+
// because renderers read `value` from hProperties.
|
|
96338
|
+
if (node.data?.hProperties && typeof node.data.hProperties === 'object') {
|
|
96339
|
+
node.data.hProperties.value = nextValue;
|
|
96340
|
+
}
|
|
96341
|
+
});
|
|
96342
|
+
return tree;
|
|
96343
|
+
};
|
|
96344
|
+
/* harmony default export */ const variables_code = (variablesCodeResolver);
|
|
96345
|
+
|
|
95903
96346
|
;// ./processor/transform/mdxish/variables-text.ts
|
|
95904
96347
|
|
|
95905
96348
|
|
|
@@ -95913,13 +96356,38 @@ function terminateHtmlFlowBlocks(content) {
|
|
|
95913
96356
|
* Captures the field name in group 1 (dot notation) or group 2 (bracket notation)
|
|
95914
96357
|
*/
|
|
95915
96358
|
const USER_VAR_REGEX = /\{user\.(\w+)\}|\{user\[['"](\w+)['"]\]\}/g;
|
|
96359
|
+
function makeVariableNode(varName, rawValue) {
|
|
96360
|
+
return {
|
|
96361
|
+
type: NodeTypes.variable,
|
|
96362
|
+
data: {
|
|
96363
|
+
hName: 'Variable',
|
|
96364
|
+
hProperties: { name: varName },
|
|
96365
|
+
},
|
|
96366
|
+
value: rawValue,
|
|
96367
|
+
};
|
|
96368
|
+
}
|
|
95916
96369
|
/**
|
|
95917
|
-
* A remark plugin that parses {user.<field>} patterns from text nodes
|
|
95918
|
-
*
|
|
96370
|
+
* A remark plugin that parses {user.<field>} patterns from text nodes and
|
|
96371
|
+
* mdxTextExpression nodes, creating Variable nodes for runtime resolution.
|
|
96372
|
+
*
|
|
96373
|
+
* Handles both:
|
|
96374
|
+
* - `text` nodes: when safeMode is true or after expression evaluation
|
|
96375
|
+
* - `mdxTextExpression` nodes: when mdxExpression has parsed {user.*} before evaluation
|
|
95919
96376
|
*
|
|
95920
96377
|
* Supports any user field: name, email, email_verified, exp, iat, etc.
|
|
95921
96378
|
*/
|
|
95922
96379
|
const variablesTextTransformer = () => tree => {
|
|
96380
|
+
// Handle mdxTextExpression nodes (e.g. {user.name} parsed by mdxExpression)
|
|
96381
|
+
visit(tree, 'mdxTextExpression', (node, index, parent) => {
|
|
96382
|
+
if (index === undefined || !parent)
|
|
96383
|
+
return;
|
|
96384
|
+
const wrapped = `{${(node.value ?? '').trim()}}`; // Wrap the expression value in {} to match the USER_VAR_REGEX pattern
|
|
96385
|
+
const matches = [...wrapped.matchAll(USER_VAR_REGEX)];
|
|
96386
|
+
if (matches.length !== 1)
|
|
96387
|
+
return;
|
|
96388
|
+
const varName = matches[0][1] || matches[0][2];
|
|
96389
|
+
parent.children.splice(index, 1, makeVariableNode(varName, wrapped));
|
|
96390
|
+
});
|
|
95923
96391
|
visit(tree, 'text', (node, index, parent) => {
|
|
95924
96392
|
if (index === undefined || !parent)
|
|
95925
96393
|
return;
|
|
@@ -95944,15 +96412,7 @@ const variablesTextTransformer = () => tree => {
|
|
|
95944
96412
|
}
|
|
95945
96413
|
// Extract variable name from either capture group (dot or bracket notation)
|
|
95946
96414
|
const varName = match[1] || match[2];
|
|
95947
|
-
|
|
95948
|
-
parts.push({
|
|
95949
|
-
type: NodeTypes.variable,
|
|
95950
|
-
data: {
|
|
95951
|
-
hName: 'Variable',
|
|
95952
|
-
hProperties: { name: varName },
|
|
95953
|
-
},
|
|
95954
|
-
value: match[0],
|
|
95955
|
-
});
|
|
96415
|
+
parts.push(makeVariableNode(varName, match[0]));
|
|
95956
96416
|
lastIndex = matchIndex + match[0].length;
|
|
95957
96417
|
});
|
|
95958
96418
|
// Add remaining text after last match
|
|
@@ -95969,7 +96429,7 @@ const variablesTextTransformer = () => tree => {
|
|
|
95969
96429
|
/* harmony default export */ const variables_text = (variablesTextTransformer);
|
|
95970
96430
|
|
|
95971
96431
|
;// ./lib/mdast-util/magic-block/index.ts
|
|
95972
|
-
const
|
|
96432
|
+
const magic_block_contextMap = new WeakMap();
|
|
95973
96433
|
/**
|
|
95974
96434
|
* Find the magicBlock token in the token ancestry.
|
|
95975
96435
|
*/
|
|
@@ -95989,7 +96449,7 @@ function findMagicBlockToken() {
|
|
|
95989
96449
|
*/
|
|
95990
96450
|
function enterMagicBlock(token) {
|
|
95991
96451
|
// Initialize context for this magic block
|
|
95992
|
-
|
|
96452
|
+
magic_block_contextMap.set(token, { blockType: '', dataChunks: [] });
|
|
95993
96453
|
this.enter({
|
|
95994
96454
|
type: 'magicBlock',
|
|
95995
96455
|
blockType: '',
|
|
@@ -96004,7 +96464,7 @@ function exitMagicBlockType(token) {
|
|
|
96004
96464
|
const blockToken = findMagicBlockToken.call(this);
|
|
96005
96465
|
if (!blockToken)
|
|
96006
96466
|
return;
|
|
96007
|
-
const context =
|
|
96467
|
+
const context = magic_block_contextMap.get(blockToken);
|
|
96008
96468
|
if (context) {
|
|
96009
96469
|
context.blockType = this.sliceSerialize(token);
|
|
96010
96470
|
}
|
|
@@ -96016,7 +96476,7 @@ function exitMagicBlockData(token) {
|
|
|
96016
96476
|
const blockToken = findMagicBlockToken.call(this);
|
|
96017
96477
|
if (!blockToken)
|
|
96018
96478
|
return;
|
|
96019
|
-
const context =
|
|
96479
|
+
const context = magic_block_contextMap.get(blockToken);
|
|
96020
96480
|
if (context) {
|
|
96021
96481
|
context.dataChunks.push(this.sliceSerialize(token));
|
|
96022
96482
|
}
|
|
@@ -96028,7 +96488,7 @@ function exitMagicBlockLineEnding(token) {
|
|
|
96028
96488
|
const blockToken = findMagicBlockToken.call(this);
|
|
96029
96489
|
if (!blockToken)
|
|
96030
96490
|
return;
|
|
96031
|
-
const context =
|
|
96491
|
+
const context = magic_block_contextMap.get(blockToken);
|
|
96032
96492
|
if (context) {
|
|
96033
96493
|
context.dataChunks.push(this.sliceSerialize(token));
|
|
96034
96494
|
}
|
|
@@ -96046,7 +96506,7 @@ function exitMagicBlockMarkerEnd(token) {
|
|
|
96046
96506
|
// If this marker doesn't end with ']', it's a failed check and content belongs to data
|
|
96047
96507
|
// The successful end marker would be "[/block]"
|
|
96048
96508
|
if (!markerContent.endsWith(']') || markerContent !== '[/block]') {
|
|
96049
|
-
const context =
|
|
96509
|
+
const context = magic_block_contextMap.get(blockToken);
|
|
96050
96510
|
if (context) {
|
|
96051
96511
|
context.dataChunks.push(markerContent);
|
|
96052
96512
|
}
|
|
@@ -96056,7 +96516,7 @@ function exitMagicBlockMarkerEnd(token) {
|
|
|
96056
96516
|
* Exit handler: Finalize the magicBlock node with parsed JSON data.
|
|
96057
96517
|
*/
|
|
96058
96518
|
function exitMagicBlock(token) {
|
|
96059
|
-
const context =
|
|
96519
|
+
const context = magic_block_contextMap.get(token);
|
|
96060
96520
|
const node = this.stack[this.stack.length - 1];
|
|
96061
96521
|
if (context) {
|
|
96062
96522
|
const rawJson = context.dataChunks.join('');
|
|
@@ -96071,7 +96531,7 @@ function exitMagicBlock(token) {
|
|
|
96071
96531
|
node.data = {};
|
|
96072
96532
|
}
|
|
96073
96533
|
// Clean up context
|
|
96074
|
-
|
|
96534
|
+
magic_block_contextMap.delete(token);
|
|
96075
96535
|
}
|
|
96076
96536
|
this.exit(token);
|
|
96077
96537
|
}
|
|
@@ -96124,166 +96584,6 @@ function magicBlockToMarkdown() {
|
|
|
96124
96584
|
};
|
|
96125
96585
|
}
|
|
96126
96586
|
|
|
96127
|
-
;// ./node_modules/micromark-util-symbol/lib/codes.js
|
|
96128
|
-
/**
|
|
96129
|
-
* Character codes.
|
|
96130
|
-
*
|
|
96131
|
-
* This module is compiled away!
|
|
96132
|
-
*
|
|
96133
|
-
* micromark works based on character codes.
|
|
96134
|
-
* This module contains constants for the ASCII block and the replacement
|
|
96135
|
-
* character.
|
|
96136
|
-
* A couple of them are handled in a special way, such as the line endings
|
|
96137
|
-
* (CR, LF, and CR+LF, commonly known as end-of-line: EOLs), the tab (horizontal
|
|
96138
|
-
* tab) and its expansion based on what column it’s at (virtual space),
|
|
96139
|
-
* and the end-of-file (eof) character.
|
|
96140
|
-
* As values are preprocessed before handling them, the actual characters LF,
|
|
96141
|
-
* CR, HT, and NUL (which is present as the replacement character), are
|
|
96142
|
-
* guaranteed to not exist.
|
|
96143
|
-
*
|
|
96144
|
-
* Unicode basic latin block.
|
|
96145
|
-
*/
|
|
96146
|
-
const codes = /** @type {const} */ ({
|
|
96147
|
-
carriageReturn: -5,
|
|
96148
|
-
lineFeed: -4,
|
|
96149
|
-
carriageReturnLineFeed: -3,
|
|
96150
|
-
horizontalTab: -2,
|
|
96151
|
-
virtualSpace: -1,
|
|
96152
|
-
eof: null,
|
|
96153
|
-
nul: 0,
|
|
96154
|
-
soh: 1,
|
|
96155
|
-
stx: 2,
|
|
96156
|
-
etx: 3,
|
|
96157
|
-
eot: 4,
|
|
96158
|
-
enq: 5,
|
|
96159
|
-
ack: 6,
|
|
96160
|
-
bel: 7,
|
|
96161
|
-
bs: 8,
|
|
96162
|
-
ht: 9, // `\t`
|
|
96163
|
-
lf: 10, // `\n`
|
|
96164
|
-
vt: 11, // `\v`
|
|
96165
|
-
ff: 12, // `\f`
|
|
96166
|
-
cr: 13, // `\r`
|
|
96167
|
-
so: 14,
|
|
96168
|
-
si: 15,
|
|
96169
|
-
dle: 16,
|
|
96170
|
-
dc1: 17,
|
|
96171
|
-
dc2: 18,
|
|
96172
|
-
dc3: 19,
|
|
96173
|
-
dc4: 20,
|
|
96174
|
-
nak: 21,
|
|
96175
|
-
syn: 22,
|
|
96176
|
-
etb: 23,
|
|
96177
|
-
can: 24,
|
|
96178
|
-
em: 25,
|
|
96179
|
-
sub: 26,
|
|
96180
|
-
esc: 27,
|
|
96181
|
-
fs: 28,
|
|
96182
|
-
gs: 29,
|
|
96183
|
-
rs: 30,
|
|
96184
|
-
us: 31,
|
|
96185
|
-
space: 32,
|
|
96186
|
-
exclamationMark: 33, // `!`
|
|
96187
|
-
quotationMark: 34, // `"`
|
|
96188
|
-
numberSign: 35, // `#`
|
|
96189
|
-
dollarSign: 36, // `$`
|
|
96190
|
-
percentSign: 37, // `%`
|
|
96191
|
-
ampersand: 38, // `&`
|
|
96192
|
-
apostrophe: 39, // `'`
|
|
96193
|
-
leftParenthesis: 40, // `(`
|
|
96194
|
-
rightParenthesis: 41, // `)`
|
|
96195
|
-
asterisk: 42, // `*`
|
|
96196
|
-
plusSign: 43, // `+`
|
|
96197
|
-
comma: 44, // `,`
|
|
96198
|
-
dash: 45, // `-`
|
|
96199
|
-
dot: 46, // `.`
|
|
96200
|
-
slash: 47, // `/`
|
|
96201
|
-
digit0: 48, // `0`
|
|
96202
|
-
digit1: 49, // `1`
|
|
96203
|
-
digit2: 50, // `2`
|
|
96204
|
-
digit3: 51, // `3`
|
|
96205
|
-
digit4: 52, // `4`
|
|
96206
|
-
digit5: 53, // `5`
|
|
96207
|
-
digit6: 54, // `6`
|
|
96208
|
-
digit7: 55, // `7`
|
|
96209
|
-
digit8: 56, // `8`
|
|
96210
|
-
digit9: 57, // `9`
|
|
96211
|
-
colon: 58, // `:`
|
|
96212
|
-
semicolon: 59, // `;`
|
|
96213
|
-
lessThan: 60, // `<`
|
|
96214
|
-
equalsTo: 61, // `=`
|
|
96215
|
-
greaterThan: 62, // `>`
|
|
96216
|
-
questionMark: 63, // `?`
|
|
96217
|
-
atSign: 64, // `@`
|
|
96218
|
-
uppercaseA: 65, // `A`
|
|
96219
|
-
uppercaseB: 66, // `B`
|
|
96220
|
-
uppercaseC: 67, // `C`
|
|
96221
|
-
uppercaseD: 68, // `D`
|
|
96222
|
-
uppercaseE: 69, // `E`
|
|
96223
|
-
uppercaseF: 70, // `F`
|
|
96224
|
-
uppercaseG: 71, // `G`
|
|
96225
|
-
uppercaseH: 72, // `H`
|
|
96226
|
-
uppercaseI: 73, // `I`
|
|
96227
|
-
uppercaseJ: 74, // `J`
|
|
96228
|
-
uppercaseK: 75, // `K`
|
|
96229
|
-
uppercaseL: 76, // `L`
|
|
96230
|
-
uppercaseM: 77, // `M`
|
|
96231
|
-
uppercaseN: 78, // `N`
|
|
96232
|
-
uppercaseO: 79, // `O`
|
|
96233
|
-
uppercaseP: 80, // `P`
|
|
96234
|
-
uppercaseQ: 81, // `Q`
|
|
96235
|
-
uppercaseR: 82, // `R`
|
|
96236
|
-
uppercaseS: 83, // `S`
|
|
96237
|
-
uppercaseT: 84, // `T`
|
|
96238
|
-
uppercaseU: 85, // `U`
|
|
96239
|
-
uppercaseV: 86, // `V`
|
|
96240
|
-
uppercaseW: 87, // `W`
|
|
96241
|
-
uppercaseX: 88, // `X`
|
|
96242
|
-
uppercaseY: 89, // `Y`
|
|
96243
|
-
uppercaseZ: 90, // `Z`
|
|
96244
|
-
leftSquareBracket: 91, // `[`
|
|
96245
|
-
backslash: 92, // `\`
|
|
96246
|
-
rightSquareBracket: 93, // `]`
|
|
96247
|
-
caret: 94, // `^`
|
|
96248
|
-
underscore: 95, // `_`
|
|
96249
|
-
graveAccent: 96, // `` ` ``
|
|
96250
|
-
lowercaseA: 97, // `a`
|
|
96251
|
-
lowercaseB: 98, // `b`
|
|
96252
|
-
lowercaseC: 99, // `c`
|
|
96253
|
-
lowercaseD: 100, // `d`
|
|
96254
|
-
lowercaseE: 101, // `e`
|
|
96255
|
-
lowercaseF: 102, // `f`
|
|
96256
|
-
lowercaseG: 103, // `g`
|
|
96257
|
-
lowercaseH: 104, // `h`
|
|
96258
|
-
lowercaseI: 105, // `i`
|
|
96259
|
-
lowercaseJ: 106, // `j`
|
|
96260
|
-
lowercaseK: 107, // `k`
|
|
96261
|
-
lowercaseL: 108, // `l`
|
|
96262
|
-
lowercaseM: 109, // `m`
|
|
96263
|
-
lowercaseN: 110, // `n`
|
|
96264
|
-
lowercaseO: 111, // `o`
|
|
96265
|
-
lowercaseP: 112, // `p`
|
|
96266
|
-
lowercaseQ: 113, // `q`
|
|
96267
|
-
lowercaseR: 114, // `r`
|
|
96268
|
-
lowercaseS: 115, // `s`
|
|
96269
|
-
lowercaseT: 116, // `t`
|
|
96270
|
-
lowercaseU: 117, // `u`
|
|
96271
|
-
lowercaseV: 118, // `v`
|
|
96272
|
-
lowercaseW: 119, // `w`
|
|
96273
|
-
lowercaseX: 120, // `x`
|
|
96274
|
-
lowercaseY: 121, // `y`
|
|
96275
|
-
lowercaseZ: 122, // `z`
|
|
96276
|
-
leftCurlyBrace: 123, // `{`
|
|
96277
|
-
verticalBar: 124, // `|`
|
|
96278
|
-
rightCurlyBrace: 125, // `}`
|
|
96279
|
-
tilde: 126, // `~`
|
|
96280
|
-
del: 127,
|
|
96281
|
-
// Unicode Specials block.
|
|
96282
|
-
byteOrderMarker: 65_279,
|
|
96283
|
-
// Unicode Specials block.
|
|
96284
|
-
replacementCharacter: 65_533 // `�`
|
|
96285
|
-
})
|
|
96286
|
-
|
|
96287
96587
|
;// ./lib/micromark/magic-block/syntax.ts
|
|
96288
96588
|
|
|
96289
96589
|
|
|
@@ -97202,6 +97502,10 @@ function loadComponents() {
|
|
|
97202
97502
|
|
|
97203
97503
|
|
|
97204
97504
|
|
|
97505
|
+
|
|
97506
|
+
|
|
97507
|
+
|
|
97508
|
+
|
|
97205
97509
|
|
|
97206
97510
|
|
|
97207
97511
|
|
|
@@ -97250,8 +97554,10 @@ function mdxishAstProcessor(mdContent, opts = {}) {
|
|
|
97250
97554
|
text: mdxExprExt.text,
|
|
97251
97555
|
};
|
|
97252
97556
|
const processor = unified()
|
|
97253
|
-
.data('micromarkExtensions', safeMode ? [magicBlock()] : [magicBlock(), mdxExprTextOnly])
|
|
97254
|
-
.data('fromMarkdownExtensions', safeMode
|
|
97557
|
+
.data('micromarkExtensions', safeMode ? [magicBlock(), legacyVariable()] : [magicBlock(), mdxExprTextOnly, legacyVariable()])
|
|
97558
|
+
.data('fromMarkdownExtensions', safeMode
|
|
97559
|
+
? [magicBlockFromMarkdown(), legacyVariableFromMarkdown()]
|
|
97560
|
+
: [magicBlockFromMarkdown(), mdxExpressionFromMarkdown(), legacyVariableFromMarkdown()])
|
|
97255
97561
|
.use(remarkParse)
|
|
97256
97562
|
.use(remarkFrontmatter)
|
|
97257
97563
|
.use(normalize_malformed_md_syntax)
|
|
@@ -97263,8 +97569,7 @@ function mdxishAstProcessor(mdContent, opts = {}) {
|
|
|
97263
97569
|
.use(mdxish_tables)
|
|
97264
97570
|
.use(mdxish_html_blocks)
|
|
97265
97571
|
.use(newEditorTypes ? mdxish_jsx_to_mdast : undefined) // Convert JSX elements to MDAST types
|
|
97266
|
-
.use(
|
|
97267
|
-
.use(variables_text) // Parse {user.*} patterns from text
|
|
97572
|
+
.use(variables_text) // Parse {user.*} patterns from text nodes
|
|
97268
97573
|
.use(useTailwind ? transform_tailwind : undefined, { components: tempComponentsMap })
|
|
97269
97574
|
.use(remarkGfm);
|
|
97270
97575
|
return {
|
|
@@ -97298,20 +97603,26 @@ function mdxishMdastToMd(mdast) {
|
|
|
97298
97603
|
* @see {@link https://github.com/readmeio/rmdx/blob/main/docs/mdxish-flow.md}
|
|
97299
97604
|
*/
|
|
97300
97605
|
function mdxish(mdContent, opts = {}) {
|
|
97301
|
-
const { components: userComponents = {} } = opts;
|
|
97606
|
+
const { components: userComponents = {}, jsxContext = {}, safeMode = false, variables } = opts;
|
|
97302
97607
|
const components = {
|
|
97303
97608
|
...loadComponents(),
|
|
97304
97609
|
...userComponents,
|
|
97305
97610
|
};
|
|
97306
|
-
|
|
97611
|
+
// Remove JSX comments before processing (protect code blocks first)
|
|
97612
|
+
const { protectedCode, protectedContent } = protectCodeBlocks(mdContent);
|
|
97613
|
+
const withoutComments = removeJSXComments(protectedContent);
|
|
97614
|
+
const contentWithoutComments = restoreCodeBlocks(withoutComments, protectedCode);
|
|
97615
|
+
const { processor, parserReadyContent } = mdxishAstProcessor(contentWithoutComments, opts);
|
|
97307
97616
|
processor
|
|
97617
|
+
.use(safeMode ? undefined : evaluate_expressions, { context: jsxContext }) // Evaluate MDX expressions using jsxContext
|
|
97308
97618
|
.use(remarkBreaks)
|
|
97619
|
+
.use(variables_code, { variables }) // Resolve <<...>> and {user.*} inside code and inline code nodes
|
|
97309
97620
|
.use(remarkRehype, { allowDangerousHtml: true, handlers: mdxComponentHandlers })
|
|
97310
97621
|
.use(preserveBooleanProperties) // RehypeRaw converts boolean properties to empty strings
|
|
97311
97622
|
.use(rehypeRaw, { passThrough: ['html-block'] })
|
|
97312
97623
|
.use(restoreBooleanProperties)
|
|
97313
97624
|
.use(mdxish_mermaid) // Add mermaid-render className to pre wrappers
|
|
97314
|
-
.use(
|
|
97625
|
+
.use(heading_slugs)
|
|
97315
97626
|
.use(rehypeMdxishComponents, {
|
|
97316
97627
|
components,
|
|
97317
97628
|
processMarkdown: (markdown) => mdxish(markdown, opts),
|
|
@@ -97451,9 +97762,6 @@ const migrate = (doc, opts) => {
|
|
|
97451
97762
|
};
|
|
97452
97763
|
/* harmony default export */ const lib_migrate = (migrate);
|
|
97453
97764
|
|
|
97454
|
-
// EXTERNAL MODULE: external "@readme/variable"
|
|
97455
|
-
var variable_ = __webpack_require__(8167);
|
|
97456
|
-
var variable_default = /*#__PURE__*/__webpack_require__.n(variable_);
|
|
97457
97765
|
// EXTERNAL MODULE: ./node_modules/rehype-react/index.js
|
|
97458
97766
|
var rehype_react = __webpack_require__(26);
|
|
97459
97767
|
var rehype_react_default = /*#__PURE__*/__webpack_require__.n(rehype_react);
|
|
@@ -97865,6 +98173,7 @@ function restoreMagicBlocks(replaced, blocks) {
|
|
|
97865
98173
|
|
|
97866
98174
|
|
|
97867
98175
|
|
|
98176
|
+
|
|
97868
98177
|
/**
|
|
97869
98178
|
* Removes Markdown and MDX comments.
|
|
97870
98179
|
*/
|
|
@@ -97885,6 +98194,7 @@ async function stripComments(doc, { mdx, mdxish } = {}) {
|
|
|
97885
98194
|
.use(normalize_malformed_md_syntax)
|
|
97886
98195
|
.use(mdx ? remarkMdx : undefined)
|
|
97887
98196
|
.use(stripCommentsTransformer)
|
|
98197
|
+
.use(remarkGfm)
|
|
97888
98198
|
.use(remarkStringify, mdx
|
|
97889
98199
|
? {}
|
|
97890
98200
|
: {
|