@readme/markdown 11.5.0 → 11.5.2
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
|
@@ -67873,6 +67873,9 @@ const visitor = (table, index, parent) => {
|
|
|
67873
67873
|
const content = cell.children.length === 1 && cell.children[0].type === 'paragraph'
|
|
67874
67874
|
? cell.children[0].children[0]
|
|
67875
67875
|
: cell.children[0];
|
|
67876
|
+
// If cell is empty there's nothing to visit
|
|
67877
|
+
if (!content)
|
|
67878
|
+
return EXIT;
|
|
67876
67879
|
// @note: Compatibility with RDMD. Ideally, I'd put this in a separate
|
|
67877
67880
|
// transformer, but then there'd be some duplication.
|
|
67878
67881
|
visit(cell, 'break', (_, breakIndex, breakParent) => {
|
|
@@ -87760,14 +87763,14 @@ const migrateHtmlTags = () => (tree) => {
|
|
|
87760
87763
|
;// ./processor/transform/migrate-link-references.ts
|
|
87761
87764
|
|
|
87762
87765
|
|
|
87763
|
-
const migrateLinkReferences = () => {
|
|
87764
|
-
return (tree
|
|
87766
|
+
const migrateLinkReferences = ({ rdmd }) => {
|
|
87767
|
+
return (tree) => {
|
|
87765
87768
|
visit(tree, 'linkReference', (node, index, parent) => {
|
|
87766
87769
|
if (!('children' in parent))
|
|
87767
87770
|
return;
|
|
87768
87771
|
parent.children.splice(index, 1, {
|
|
87769
87772
|
type: NodeTypes.plain,
|
|
87770
|
-
value:
|
|
87773
|
+
value: rdmd.md(node).trim(),
|
|
87771
87774
|
});
|
|
87772
87775
|
});
|
|
87773
87776
|
};
|
|
@@ -87782,7 +87785,7 @@ const migrateLinkReferences = () => {
|
|
|
87782
87785
|
|
|
87783
87786
|
const migrate = (doc, { rdmd }) => {
|
|
87784
87787
|
const ast = lib_mdastV6(doc, { rdmd });
|
|
87785
|
-
return (lib_mdx(ast, { remarkTransformers: [migrate_callouts, migrate_link_references, migrate_html_tags], file: doc })
|
|
87788
|
+
return (lib_mdx(ast, { remarkTransformers: [migrate_callouts, [migrate_link_references, { rdmd }], migrate_html_tags], file: doc })
|
|
87786
87789
|
.replaceAll(/ /g, ' ')
|
|
87787
87790
|
// @note: I'm not sure what's happening, but I think mdx is converting an
|
|
87788
87791
|
// 'a' to 'a' as a means of escaping it. I think this helps with
|
package/dist/main.node.js
CHANGED
|
@@ -88084,6 +88084,9 @@ const visitor = (table, index, parent) => {
|
|
|
88084
88084
|
const content = cell.children.length === 1 && cell.children[0].type === 'paragraph'
|
|
88085
88085
|
? cell.children[0].children[0]
|
|
88086
88086
|
: cell.children[0];
|
|
88087
|
+
// If cell is empty there's nothing to visit
|
|
88088
|
+
if (!content)
|
|
88089
|
+
return EXIT;
|
|
88087
88090
|
// @note: Compatibility with RDMD. Ideally, I'd put this in a separate
|
|
88088
88091
|
// transformer, but then there'd be some duplication.
|
|
88089
88092
|
visit(cell, 'break', (_, breakIndex, breakParent) => {
|
|
@@ -107971,14 +107974,14 @@ const migrateHtmlTags = () => (tree) => {
|
|
|
107971
107974
|
;// ./processor/transform/migrate-link-references.ts
|
|
107972
107975
|
|
|
107973
107976
|
|
|
107974
|
-
const migrateLinkReferences = () => {
|
|
107975
|
-
return (tree
|
|
107977
|
+
const migrateLinkReferences = ({ rdmd }) => {
|
|
107978
|
+
return (tree) => {
|
|
107976
107979
|
visit(tree, 'linkReference', (node, index, parent) => {
|
|
107977
107980
|
if (!('children' in parent))
|
|
107978
107981
|
return;
|
|
107979
107982
|
parent.children.splice(index, 1, {
|
|
107980
107983
|
type: NodeTypes.plain,
|
|
107981
|
-
value:
|
|
107984
|
+
value: rdmd.md(node).trim(),
|
|
107982
107985
|
});
|
|
107983
107986
|
});
|
|
107984
107987
|
};
|
|
@@ -107993,7 +107996,7 @@ const migrateLinkReferences = () => {
|
|
|
107993
107996
|
|
|
107994
107997
|
const migrate = (doc, { rdmd }) => {
|
|
107995
107998
|
const ast = lib_mdastV6(doc, { rdmd });
|
|
107996
|
-
return (lib_mdx(ast, { remarkTransformers: [migrate_callouts, migrate_link_references, migrate_html_tags], file: doc })
|
|
107999
|
+
return (lib_mdx(ast, { remarkTransformers: [migrate_callouts, [migrate_link_references, { rdmd }], migrate_html_tags], file: doc })
|
|
107997
108000
|
.replaceAll(/ /g, ' ')
|
|
107998
108001
|
// @note: I'm not sure what's happening, but I think mdx is converting an
|
|
107999
108002
|
// 'a' to 'a' as a means of escaping it. I think this helps with
|