@readme/markdown 11.7.4 → 11.7.5
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/main.js +15 -1
- package/dist/main.node.js +15 -1
- package/dist/main.node.js.map +1 -1
- package/package.json +1 -1
package/dist/main.js
CHANGED
|
@@ -88462,6 +88462,7 @@ function restoreMagicBlocks(replaced, blocks) {
|
|
|
88462
88462
|
|
|
88463
88463
|
|
|
88464
88464
|
|
|
88465
|
+
|
|
88465
88466
|
/**
|
|
88466
88467
|
* Removes Markdown and MDX comments.
|
|
88467
88468
|
*/
|
|
@@ -88471,7 +88472,20 @@ async function stripComments(doc, { mdx } = {}) {
|
|
|
88471
88472
|
.use(remarkParse)
|
|
88472
88473
|
.use(mdx ? remarkMdx : undefined)
|
|
88473
88474
|
.use(stripCommentsTransformer)
|
|
88474
|
-
.use(remarkStringify
|
|
88475
|
+
.use(remarkStringify, mdx
|
|
88476
|
+
? {}
|
|
88477
|
+
: {
|
|
88478
|
+
handlers: {
|
|
88479
|
+
// Preserve <<...>> variables without escaping any angle brackets.
|
|
88480
|
+
text(node, _, state, info) {
|
|
88481
|
+
// If text contains <<...>> pattern, return as is.
|
|
88482
|
+
if (new RegExp(variable_.VARIABLE_REGEXP).test(node.value))
|
|
88483
|
+
return node.value;
|
|
88484
|
+
// Otherwise, handle each text node normally.
|
|
88485
|
+
return state.safe(node.value, info);
|
|
88486
|
+
},
|
|
88487
|
+
},
|
|
88488
|
+
});
|
|
88475
88489
|
const file = await processor.process(replaced);
|
|
88476
88490
|
const stringified = String(file).trim();
|
|
88477
88491
|
const restored = restoreMagicBlocks(stringified, blocks);
|
package/dist/main.node.js
CHANGED
|
@@ -108666,6 +108666,7 @@ function restoreMagicBlocks(replaced, blocks) {
|
|
|
108666
108666
|
|
|
108667
108667
|
|
|
108668
108668
|
|
|
108669
|
+
|
|
108669
108670
|
/**
|
|
108670
108671
|
* Removes Markdown and MDX comments.
|
|
108671
108672
|
*/
|
|
@@ -108675,7 +108676,20 @@ async function stripComments(doc, { mdx } = {}) {
|
|
|
108675
108676
|
.use(remarkParse)
|
|
108676
108677
|
.use(mdx ? remarkMdx : undefined)
|
|
108677
108678
|
.use(stripCommentsTransformer)
|
|
108678
|
-
.use(remarkStringify
|
|
108679
|
+
.use(remarkStringify, mdx
|
|
108680
|
+
? {}
|
|
108681
|
+
: {
|
|
108682
|
+
handlers: {
|
|
108683
|
+
// Preserve <<...>> variables without escaping any angle brackets.
|
|
108684
|
+
text(node, _, state, info) {
|
|
108685
|
+
// If text contains <<...>> pattern, return as is.
|
|
108686
|
+
if (new RegExp(dist.VARIABLE_REGEXP).test(node.value))
|
|
108687
|
+
return node.value;
|
|
108688
|
+
// Otherwise, handle each text node normally.
|
|
108689
|
+
return state.safe(node.value, info);
|
|
108690
|
+
},
|
|
108691
|
+
},
|
|
108692
|
+
});
|
|
108679
108693
|
const file = await processor.process(replaced);
|
|
108680
108694
|
const stringified = String(file).trim();
|
|
108681
108695
|
const restored = restoreMagicBlocks(stringified, blocks);
|