@readme/markdown 11.9.3 → 11.10.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.d.ts +1 -1
- package/dist/lib/index.d.ts +1 -0
- package/dist/lib/mdxishTags.d.ts +2 -0
- package/dist/main.js +36 -5
- package/dist/main.node.js +32 -1
- package/dist/main.node.js.map +1 -1
- package/package.json +1 -1
package/dist/index.d.ts
CHANGED
|
@@ -6,7 +6,7 @@ declare const utils: {
|
|
|
6
6
|
getHref: typeof getHref;
|
|
7
7
|
calloutIcons: {};
|
|
8
8
|
};
|
|
9
|
-
export { compile, exports, hast, run, mdast, mdastV6, mdx, mdxish, migrate, mix, plain, renderMdxish, remarkPlugins, stripComments, tags, } from './lib';
|
|
9
|
+
export { compile, exports, hast, run, mdast, mdastV6, mdx, mdxish, mdxishTags, migrate, mix, plain, renderMdxish, remarkPlugins, stripComments, tags, } from './lib';
|
|
10
10
|
export { default as Owlmoji } from './lib/owlmoji';
|
|
11
11
|
export { Components, utils };
|
|
12
12
|
export { tailwindCompiler } from './utils/tailwind-compiler';
|
package/dist/lib/index.d.ts
CHANGED
|
@@ -15,4 +15,5 @@ export { default as renderMdxish } from './renderMdxish';
|
|
|
15
15
|
export type { RenderMdxishOpts } from './renderMdxish';
|
|
16
16
|
export { default as run } from './run';
|
|
17
17
|
export { default as tags } from './tags';
|
|
18
|
+
export { default as mdxishTags } from './mdxishTags';
|
|
18
19
|
export { default as stripComments } from './stripComments';
|
package/dist/main.js
CHANGED
|
@@ -2030,7 +2030,7 @@ module.exports = function (it) {
|
|
|
2030
2030
|
|
|
2031
2031
|
"use strict";
|
|
2032
2032
|
|
|
2033
|
-
var create = __webpack_require__(
|
|
2033
|
+
var create = __webpack_require__(7100);
|
|
2034
2034
|
var descriptor = __webpack_require__(1996);
|
|
2035
2035
|
var setToStringTag = __webpack_require__(3844);
|
|
2036
2036
|
var IteratorPrototype = {};
|
|
@@ -2209,7 +2209,7 @@ var meta = module.exports = {
|
|
|
2209
2209
|
|
|
2210
2210
|
/***/ }),
|
|
2211
2211
|
|
|
2212
|
-
/***/
|
|
2212
|
+
/***/ 7100:
|
|
2213
2213
|
/***/ ((module, __unused_webpack_exports, __webpack_require__) => {
|
|
2214
2214
|
|
|
2215
2215
|
// 19.1.2.2 / 15.2.3.5 Object.create(O [, Properties])
|
|
@@ -2940,7 +2940,7 @@ var $Number = global[NUMBER];
|
|
|
2940
2940
|
var Base = $Number;
|
|
2941
2941
|
var proto = $Number.prototype;
|
|
2942
2942
|
// Opera ~12 has broken Object#toString
|
|
2943
|
-
var BROKEN_COF = cof(__webpack_require__(
|
|
2943
|
+
var BROKEN_COF = cof(__webpack_require__(7100)(proto)) == NUMBER;
|
|
2944
2944
|
var TRIM = 'trim' in String.prototype;
|
|
2945
2945
|
|
|
2946
2946
|
// 7.1.3 ToNumber(argument)
|
|
@@ -3139,7 +3139,7 @@ var toObject = __webpack_require__(8270);
|
|
|
3139
3139
|
var toIObject = __webpack_require__(7221);
|
|
3140
3140
|
var toPrimitive = __webpack_require__(3048);
|
|
3141
3141
|
var createDesc = __webpack_require__(1996);
|
|
3142
|
-
var _create = __webpack_require__(
|
|
3142
|
+
var _create = __webpack_require__(7100);
|
|
3143
3143
|
var gOPNExt = __webpack_require__(4765);
|
|
3144
3144
|
var $GOPD = __webpack_require__(8641);
|
|
3145
3145
|
var $GOPS = __webpack_require__(1060);
|
|
@@ -11366,6 +11366,7 @@ __webpack_require__.d(__webpack_exports__, {
|
|
|
11366
11366
|
mdastV6: () => (/* reexport */ lib_mdastV6),
|
|
11367
11367
|
mdx: () => (/* reexport */ lib_mdx),
|
|
11368
11368
|
mdxish: () => (/* reexport */ lib_mdxish),
|
|
11369
|
+
mdxishTags: () => (/* reexport */ mdxishTags),
|
|
11369
11370
|
migrate: () => (/* reexport */ lib_migrate),
|
|
11370
11371
|
mix: () => (/* reexport */ lib_mix),
|
|
11371
11372
|
plain: () => (/* reexport */ lib_plain),
|
|
@@ -94042,9 +94043,17 @@ function extractMagicBlocks(markdown) {
|
|
|
94042
94043
|
* Restore extracted magic blocks back into a markdown string.
|
|
94043
94044
|
*/
|
|
94044
94045
|
function restoreMagicBlocks(replaced, blocks) {
|
|
94046
|
+
let content = replaced;
|
|
94047
|
+
// If a magic block is at the start of the document, the extraction token's prepended
|
|
94048
|
+
// newline will have been trimmed during processing. We need to account for that here
|
|
94049
|
+
// to ensure the token is found and replaced correctly.
|
|
94050
|
+
const isTokenAtStart = content.startsWith(blocks[0]?.token.trimStart());
|
|
94051
|
+
if (isTokenAtStart) {
|
|
94052
|
+
content = `\n${content}`;
|
|
94053
|
+
}
|
|
94045
94054
|
return blocks.reduce((acc, { token, raw }) => {
|
|
94046
94055
|
return acc.split(token).join(raw);
|
|
94047
|
-
},
|
|
94056
|
+
}, content);
|
|
94048
94057
|
}
|
|
94049
94058
|
|
|
94050
94059
|
;// ./lib/utils/mdxish/mdxish-load-components.ts
|
|
@@ -94579,6 +94588,27 @@ const tags = (doc) => {
|
|
|
94579
94588
|
};
|
|
94580
94589
|
/* harmony default export */ const lib_tags = (tags);
|
|
94581
94590
|
|
|
94591
|
+
;// ./lib/mdxishTags.ts
|
|
94592
|
+
|
|
94593
|
+
|
|
94594
|
+
|
|
94595
|
+
|
|
94596
|
+
|
|
94597
|
+
const mdxishTags_tags = (doc) => {
|
|
94598
|
+
const { replaced: sanitizedDoc } = extractMagicBlocks(doc);
|
|
94599
|
+
const set = new Set();
|
|
94600
|
+
const processor = remark()
|
|
94601
|
+
.use(mdxish_component_blocks);
|
|
94602
|
+
const tree = processor.parse(sanitizedDoc);
|
|
94603
|
+
visit(processor.runSync(tree), isMDXElement, (node) => {
|
|
94604
|
+
if (node.name?.match(/^[A-Z]/)) {
|
|
94605
|
+
set.add(node.name);
|
|
94606
|
+
}
|
|
94607
|
+
});
|
|
94608
|
+
return Array.from(set);
|
|
94609
|
+
};
|
|
94610
|
+
/* harmony default export */ const mdxishTags = (mdxishTags_tags);
|
|
94611
|
+
|
|
94582
94612
|
;// ./processor/transform/stripComments.ts
|
|
94583
94613
|
|
|
94584
94614
|
const HTML_COMMENT_REGEX = /<!--[\s\S]*?-->/g;
|
|
@@ -94682,6 +94712,7 @@ async function stripComments(doc, { mdx } = {}) {
|
|
|
94682
94712
|
|
|
94683
94713
|
|
|
94684
94714
|
|
|
94715
|
+
|
|
94685
94716
|
;// ./index.tsx
|
|
94686
94717
|
|
|
94687
94718
|
|
package/dist/main.node.js
CHANGED
|
@@ -19028,6 +19028,7 @@ __webpack_require__.d(__webpack_exports__, {
|
|
|
19028
19028
|
mdastV6: () => (/* reexport */ lib_mdastV6),
|
|
19029
19029
|
mdx: () => (/* reexport */ lib_mdx),
|
|
19030
19030
|
mdxish: () => (/* reexport */ lib_mdxish),
|
|
19031
|
+
mdxishTags: () => (/* reexport */ mdxishTags),
|
|
19031
19032
|
migrate: () => (/* reexport */ lib_migrate),
|
|
19032
19033
|
mix: () => (/* reexport */ lib_mix),
|
|
19033
19034
|
plain: () => (/* reexport */ lib_plain),
|
|
@@ -114246,9 +114247,17 @@ function extractMagicBlocks(markdown) {
|
|
|
114246
114247
|
* Restore extracted magic blocks back into a markdown string.
|
|
114247
114248
|
*/
|
|
114248
114249
|
function restoreMagicBlocks(replaced, blocks) {
|
|
114250
|
+
let content = replaced;
|
|
114251
|
+
// If a magic block is at the start of the document, the extraction token's prepended
|
|
114252
|
+
// newline will have been trimmed during processing. We need to account for that here
|
|
114253
|
+
// to ensure the token is found and replaced correctly.
|
|
114254
|
+
const isTokenAtStart = content.startsWith(blocks[0]?.token.trimStart());
|
|
114255
|
+
if (isTokenAtStart) {
|
|
114256
|
+
content = `\n${content}`;
|
|
114257
|
+
}
|
|
114249
114258
|
return blocks.reduce((acc, { token, raw }) => {
|
|
114250
114259
|
return acc.split(token).join(raw);
|
|
114251
|
-
},
|
|
114260
|
+
}, content);
|
|
114252
114261
|
}
|
|
114253
114262
|
|
|
114254
114263
|
;// ./lib/utils/mdxish/mdxish-load-components.ts
|
|
@@ -114783,6 +114792,27 @@ const tags = (doc) => {
|
|
|
114783
114792
|
};
|
|
114784
114793
|
/* harmony default export */ const lib_tags = (tags);
|
|
114785
114794
|
|
|
114795
|
+
;// ./lib/mdxishTags.ts
|
|
114796
|
+
|
|
114797
|
+
|
|
114798
|
+
|
|
114799
|
+
|
|
114800
|
+
|
|
114801
|
+
const mdxishTags_tags = (doc) => {
|
|
114802
|
+
const { replaced: sanitizedDoc } = extractMagicBlocks(doc);
|
|
114803
|
+
const set = new Set();
|
|
114804
|
+
const processor = remark()
|
|
114805
|
+
.use(mdxish_component_blocks);
|
|
114806
|
+
const tree = processor.parse(sanitizedDoc);
|
|
114807
|
+
visit(processor.runSync(tree), isMDXElement, (node) => {
|
|
114808
|
+
if (node.name?.match(/^[A-Z]/)) {
|
|
114809
|
+
set.add(node.name);
|
|
114810
|
+
}
|
|
114811
|
+
});
|
|
114812
|
+
return Array.from(set);
|
|
114813
|
+
};
|
|
114814
|
+
/* harmony default export */ const mdxishTags = (mdxishTags_tags);
|
|
114815
|
+
|
|
114786
114816
|
;// ./processor/transform/stripComments.ts
|
|
114787
114817
|
|
|
114788
114818
|
const HTML_COMMENT_REGEX = /<!--[\s\S]*?-->/g;
|
|
@@ -114886,6 +114916,7 @@ async function stripComments(doc, { mdx } = {}) {
|
|
|
114886
114916
|
|
|
114887
114917
|
|
|
114888
114918
|
|
|
114919
|
+
|
|
114889
114920
|
;// ./index.tsx
|
|
114890
114921
|
|
|
114891
114922
|
|