@readme/markdown 11.9.3 → 11.9.4
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 +9 -1
- package/dist/main.node.js +9 -1
- package/dist/main.node.js.map +1 -1
- package/package.json +1 -1
package/dist/main.js
CHANGED
|
@@ -94042,9 +94042,17 @@ function extractMagicBlocks(markdown) {
|
|
|
94042
94042
|
* Restore extracted magic blocks back into a markdown string.
|
|
94043
94043
|
*/
|
|
94044
94044
|
function restoreMagicBlocks(replaced, blocks) {
|
|
94045
|
+
let content = replaced;
|
|
94046
|
+
// If a magic block is at the start of the document, the extraction token's prepended
|
|
94047
|
+
// newline will have been trimmed during processing. We need to account for that here
|
|
94048
|
+
// to ensure the token is found and replaced correctly.
|
|
94049
|
+
const isTokenAtStart = content.startsWith(blocks[0]?.token.trimStart());
|
|
94050
|
+
if (isTokenAtStart) {
|
|
94051
|
+
content = `\n${content}`;
|
|
94052
|
+
}
|
|
94045
94053
|
return blocks.reduce((acc, { token, raw }) => {
|
|
94046
94054
|
return acc.split(token).join(raw);
|
|
94047
|
-
},
|
|
94055
|
+
}, content);
|
|
94048
94056
|
}
|
|
94049
94057
|
|
|
94050
94058
|
;// ./lib/utils/mdxish/mdxish-load-components.ts
|
package/dist/main.node.js
CHANGED
|
@@ -114246,9 +114246,17 @@ function extractMagicBlocks(markdown) {
|
|
|
114246
114246
|
* Restore extracted magic blocks back into a markdown string.
|
|
114247
114247
|
*/
|
|
114248
114248
|
function restoreMagicBlocks(replaced, blocks) {
|
|
114249
|
+
let content = replaced;
|
|
114250
|
+
// If a magic block is at the start of the document, the extraction token's prepended
|
|
114251
|
+
// newline will have been trimmed during processing. We need to account for that here
|
|
114252
|
+
// to ensure the token is found and replaced correctly.
|
|
114253
|
+
const isTokenAtStart = content.startsWith(blocks[0]?.token.trimStart());
|
|
114254
|
+
if (isTokenAtStart) {
|
|
114255
|
+
content = `\n${content}`;
|
|
114256
|
+
}
|
|
114249
114257
|
return blocks.reduce((acc, { token, raw }) => {
|
|
114250
114258
|
return acc.split(token).join(raw);
|
|
114251
|
-
},
|
|
114259
|
+
}, content);
|
|
114252
114260
|
}
|
|
114253
114261
|
|
|
114254
114262
|
;// ./lib/utils/mdxish/mdxish-load-components.ts
|