@readme/markdown 11.7.3 → 11.7.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
CHANGED
|
@@ -88092,6 +88092,21 @@ const migrateCallouts = () => (tree) => {
|
|
|
88092
88092
|
};
|
|
88093
88093
|
/* harmony default export */ const migrate_callouts = (migrateCallouts);
|
|
88094
88094
|
|
|
88095
|
+
;// ./processor/transform/migrate-html-blocks.ts
|
|
88096
|
+
|
|
88097
|
+
const MigrateHtmlBlocks = () => tree => {
|
|
88098
|
+
visit(tree, 'html-block', (node) => {
|
|
88099
|
+
const { html, runScripts } = node.data?.hProperties || {};
|
|
88100
|
+
const escaped = html.replaceAll(/\\/g, '\\\\');
|
|
88101
|
+
node.data.hProperties = {
|
|
88102
|
+
...(runScripts && { runScripts }),
|
|
88103
|
+
html: escaped,
|
|
88104
|
+
};
|
|
88105
|
+
});
|
|
88106
|
+
return tree;
|
|
88107
|
+
};
|
|
88108
|
+
/* harmony default export */ const migrate_html_blocks = (MigrateHtmlBlocks);
|
|
88109
|
+
|
|
88095
88110
|
;// ./processor/transform/migrate-html-tags.ts
|
|
88096
88111
|
|
|
88097
88112
|
// Add more visits to migrate other HTML tags here
|
|
@@ -88157,14 +88172,18 @@ const migrateComments = (doc, migrateDoc, opts) => {
|
|
|
88157
88172
|
|
|
88158
88173
|
|
|
88159
88174
|
|
|
88175
|
+
|
|
88160
88176
|
const migrateDoc = (doc, { rdmd }) => {
|
|
88161
88177
|
const ast = lib_mdastV6(doc, { rdmd });
|
|
88162
|
-
return lib_mdx(ast, {
|
|
88178
|
+
return (lib_mdx(ast, {
|
|
88179
|
+
remarkTransformers: [migrate_callouts, [migrate_link_references, { rdmd }], migrate_html_tags, migrate_html_blocks],
|
|
88180
|
+
file: doc,
|
|
88181
|
+
})
|
|
88163
88182
|
.replaceAll(/ /g, ' ')
|
|
88164
88183
|
// @note: I'm not sure what's happening, but I think mdx is converting an
|
|
88165
88184
|
// 'a' to 'a' as a means of escaping it. I think this helps with
|
|
88166
88185
|
// parsing weird cases.
|
|
88167
|
-
.replaceAll(/a/g, 'a');
|
|
88186
|
+
.replaceAll(/a/g, 'a'));
|
|
88168
88187
|
};
|
|
88169
88188
|
const migrate = (doc, opts) => {
|
|
88170
88189
|
const migratedDoc = migrateDoc(doc, opts);
|
package/dist/main.node.js
CHANGED
|
@@ -108296,6 +108296,21 @@ const migrateCallouts = () => (tree) => {
|
|
|
108296
108296
|
};
|
|
108297
108297
|
/* harmony default export */ const migrate_callouts = (migrateCallouts);
|
|
108298
108298
|
|
|
108299
|
+
;// ./processor/transform/migrate-html-blocks.ts
|
|
108300
|
+
|
|
108301
|
+
const MigrateHtmlBlocks = () => tree => {
|
|
108302
|
+
visit(tree, 'html-block', (node) => {
|
|
108303
|
+
const { html, runScripts } = node.data?.hProperties || {};
|
|
108304
|
+
const escaped = html.replaceAll(/\\/g, '\\\\');
|
|
108305
|
+
node.data.hProperties = {
|
|
108306
|
+
...(runScripts && { runScripts }),
|
|
108307
|
+
html: escaped,
|
|
108308
|
+
};
|
|
108309
|
+
});
|
|
108310
|
+
return tree;
|
|
108311
|
+
};
|
|
108312
|
+
/* harmony default export */ const migrate_html_blocks = (MigrateHtmlBlocks);
|
|
108313
|
+
|
|
108299
108314
|
;// ./processor/transform/migrate-html-tags.ts
|
|
108300
108315
|
|
|
108301
108316
|
// Add more visits to migrate other HTML tags here
|
|
@@ -108361,14 +108376,18 @@ const migrateComments = (doc, migrateDoc, opts) => {
|
|
|
108361
108376
|
|
|
108362
108377
|
|
|
108363
108378
|
|
|
108379
|
+
|
|
108364
108380
|
const migrateDoc = (doc, { rdmd }) => {
|
|
108365
108381
|
const ast = lib_mdastV6(doc, { rdmd });
|
|
108366
|
-
return lib_mdx(ast, {
|
|
108382
|
+
return (lib_mdx(ast, {
|
|
108383
|
+
remarkTransformers: [migrate_callouts, [migrate_link_references, { rdmd }], migrate_html_tags, migrate_html_blocks],
|
|
108384
|
+
file: doc,
|
|
108385
|
+
})
|
|
108367
108386
|
.replaceAll(/ /g, ' ')
|
|
108368
108387
|
// @note: I'm not sure what's happening, but I think mdx is converting an
|
|
108369
108388
|
// 'a' to 'a' as a means of escaping it. I think this helps with
|
|
108370
108389
|
// parsing weird cases.
|
|
108371
|
-
.replaceAll(/a/g, 'a');
|
|
108390
|
+
.replaceAll(/a/g, 'a'));
|
|
108372
108391
|
};
|
|
108373
108392
|
const migrate = (doc, opts) => {
|
|
108374
108393
|
const migratedDoc = migrateDoc(doc, opts);
|