@readme/markdown 7.6.1 → 7.6.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 +12 -3
- package/dist/main.node.js +12 -3
- package/package.json +1 -1
package/dist/main.js
CHANGED
|
@@ -65297,7 +65297,7 @@ const readmeToMdx = () => tree => {
|
|
|
65297
65297
|
parent.children.splice(index, 1, {
|
|
65298
65298
|
type: 'mdxJsxFlowElement',
|
|
65299
65299
|
name: 'Image',
|
|
65300
|
-
attributes: toAttributes(Object.assign(Object.assign({}, image), { src: image.src || image.url }), imageAttrs),
|
|
65300
|
+
attributes: toAttributes(Object.assign(Object.assign({}, image), { border: image.data.hProperties.className === 'border', src: image.src || image.url }), imageAttrs),
|
|
65301
65301
|
children: caption.children,
|
|
65302
65302
|
});
|
|
65303
65303
|
});
|
|
@@ -65419,6 +65419,11 @@ const visitor = (table, index, parent) => {
|
|
|
65419
65419
|
const content = cell.children.length === 1 && cell.children[0].type === 'paragraph'
|
|
65420
65420
|
? cell.children[0].children[0]
|
|
65421
65421
|
: cell.children[0];
|
|
65422
|
+
// @note: Compatibility with RDMD. Ideally, I'd put this in a separate
|
|
65423
|
+
// transformer, but then there'd be some duplication.
|
|
65424
|
+
visit(cell, 'break', (_, index, parent) => {
|
|
65425
|
+
parent.children.splice(index, 1, { type: 'text', value: '\n' });
|
|
65426
|
+
});
|
|
65422
65427
|
if (!phrasing(content)) {
|
|
65423
65428
|
hasFlowContent = true;
|
|
65424
65429
|
return EXIT;
|
|
@@ -82729,6 +82734,10 @@ const callout = (node, _, state, info) => {
|
|
|
82729
82734
|
const tracker = state.createTracker(info);
|
|
82730
82735
|
tracker.move('> ');
|
|
82731
82736
|
tracker.shift(2);
|
|
82737
|
+
// @note: compatability
|
|
82738
|
+
if (node.data.hProperties.title === '') {
|
|
82739
|
+
node.children.unshift({ type: 'paragraph', children: [{ type: 'text', value: '' }] });
|
|
82740
|
+
}
|
|
82732
82741
|
const map = (line, index, blank) => {
|
|
82733
82742
|
return `>${index === 0 ? ` ${node.data.hProperties.icon}` : ''}${blank ? '' : ' '}${line}`;
|
|
82734
82743
|
};
|
|
@@ -93929,7 +93938,7 @@ const compatibility_html = (node) => {
|
|
|
93929
93938
|
return xml.replace(/<html.*<body>(.*)<\/body><\/html>/ms, '$1');
|
|
93930
93939
|
};
|
|
93931
93940
|
const figureToImageBlock = (node) => {
|
|
93932
|
-
const _a = node.children.find((child) => child.type === 'image'), { align, width, src, url, alt, title } = _a, image = compatibility_rest(_a, ["align", "width", "src", "url", "alt", "title"]);
|
|
93941
|
+
const _a = node.children.find((child) => child.type === 'image'), { align, border, width, src, url, alt, title } = _a, image = compatibility_rest(_a, ["align", "border", "width", "src", "url", "alt", "title"]);
|
|
93933
93942
|
const { className } = image.data.hProperties;
|
|
93934
93943
|
const figcaption = node.children.find((child) => child.type === 'figcaption');
|
|
93935
93944
|
const caption = figcaption
|
|
@@ -93938,7 +93947,7 @@ const figureToImageBlock = (node) => {
|
|
|
93938
93947
|
children: figcaption.children,
|
|
93939
93948
|
}).trim()
|
|
93940
93949
|
: null;
|
|
93941
|
-
const attributes = Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign({}, (align && { align })), (alt && { alt })), (className && { border: className === 'border' })), (caption && { caption })), (title && { title })), (width && { width })), { src: src || url });
|
|
93950
|
+
const attributes = Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign({}, (align && { align })), (alt && { alt })), (className && { border: className === 'border' })), (border && { border })), (caption && { caption })), (title && { title })), (width && { width })), { src: src || url });
|
|
93942
93951
|
return `<Image ${formatProps(attributes)} />`;
|
|
93943
93952
|
};
|
|
93944
93953
|
const embedToEmbedBlock = (node) => {
|
package/dist/main.node.js
CHANGED
|
@@ -66284,7 +66284,7 @@ const readmeToMdx = () => tree => {
|
|
|
66284
66284
|
parent.children.splice(index, 1, {
|
|
66285
66285
|
type: 'mdxJsxFlowElement',
|
|
66286
66286
|
name: 'Image',
|
|
66287
|
-
attributes: toAttributes(Object.assign(Object.assign({}, image), { src: image.src || image.url }), imageAttrs),
|
|
66287
|
+
attributes: toAttributes(Object.assign(Object.assign({}, image), { border: image.data.hProperties.className === 'border', src: image.src || image.url }), imageAttrs),
|
|
66288
66288
|
children: caption.children,
|
|
66289
66289
|
});
|
|
66290
66290
|
});
|
|
@@ -66406,6 +66406,11 @@ const visitor = (table, index, parent) => {
|
|
|
66406
66406
|
const content = cell.children.length === 1 && cell.children[0].type === 'paragraph'
|
|
66407
66407
|
? cell.children[0].children[0]
|
|
66408
66408
|
: cell.children[0];
|
|
66409
|
+
// @note: Compatibility with RDMD. Ideally, I'd put this in a separate
|
|
66410
|
+
// transformer, but then there'd be some duplication.
|
|
66411
|
+
visit(cell, 'break', (_, index, parent) => {
|
|
66412
|
+
parent.children.splice(index, 1, { type: 'text', value: '\n' });
|
|
66413
|
+
});
|
|
66409
66414
|
if (!phrasing(content)) {
|
|
66410
66415
|
hasFlowContent = true;
|
|
66411
66416
|
return EXIT;
|
|
@@ -83716,6 +83721,10 @@ const callout = (node, _, state, info) => {
|
|
|
83716
83721
|
const tracker = state.createTracker(info);
|
|
83717
83722
|
tracker.move('> ');
|
|
83718
83723
|
tracker.shift(2);
|
|
83724
|
+
// @note: compatability
|
|
83725
|
+
if (node.data.hProperties.title === '') {
|
|
83726
|
+
node.children.unshift({ type: 'paragraph', children: [{ type: 'text', value: '' }] });
|
|
83727
|
+
}
|
|
83719
83728
|
const map = (line, index, blank) => {
|
|
83720
83729
|
return `>${index === 0 ? ` ${node.data.hProperties.icon}` : ''}${blank ? '' : ' '}${line}`;
|
|
83721
83730
|
};
|
|
@@ -94916,7 +94925,7 @@ const compatibility_html = (node) => {
|
|
|
94916
94925
|
return xml.replace(/<html.*<body>(.*)<\/body><\/html>/ms, '$1');
|
|
94917
94926
|
};
|
|
94918
94927
|
const figureToImageBlock = (node) => {
|
|
94919
|
-
const _a = node.children.find((child) => child.type === 'image'), { align, width, src, url, alt, title } = _a, image = compatibility_rest(_a, ["align", "width", "src", "url", "alt", "title"]);
|
|
94928
|
+
const _a = node.children.find((child) => child.type === 'image'), { align, border, width, src, url, alt, title } = _a, image = compatibility_rest(_a, ["align", "border", "width", "src", "url", "alt", "title"]);
|
|
94920
94929
|
const { className } = image.data.hProperties;
|
|
94921
94930
|
const figcaption = node.children.find((child) => child.type === 'figcaption');
|
|
94922
94931
|
const caption = figcaption
|
|
@@ -94925,7 +94934,7 @@ const figureToImageBlock = (node) => {
|
|
|
94925
94934
|
children: figcaption.children,
|
|
94926
94935
|
}).trim()
|
|
94927
94936
|
: null;
|
|
94928
|
-
const attributes = Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign({}, (align && { align })), (alt && { alt })), (className && { border: className === 'border' })), (caption && { caption })), (title && { title })), (width && { width })), { src: src || url });
|
|
94937
|
+
const attributes = Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign({}, (align && { align })), (alt && { alt })), (className && { border: className === 'border' })), (border && { border })), (caption && { caption })), (title && { title })), (width && { width })), { src: src || url });
|
|
94929
94938
|
return `<Image ${formatProps(attributes)} />`;
|
|
94930
94939
|
};
|
|
94931
94940
|
const embedToEmbedBlock = (node) => {
|
package/package.json
CHANGED