@readme/markdown 7.5.2 → 7.5.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 +4 -4
- package/dist/main.node.js +4 -4
- package/package.json +1 -1
package/dist/main.js
CHANGED
|
@@ -65169,8 +65169,8 @@ const coerceJsxToMd = ({ components = {}, html = false } = {}) => (node, index,
|
|
|
65169
65169
|
}
|
|
65170
65170
|
else if (node.name === 'Image') {
|
|
65171
65171
|
const { position } = node;
|
|
65172
|
-
const { alt = '', align, border, caption, title = null, width, src, } = getAttrs(node);
|
|
65173
|
-
const attrs = Object.assign(Object.assign(Object.assign(Object.assign(Object.assign({}, (align && { align })), (border && { border })), (src && { src })), (width && { width })), { alt, children: caption ? lib_mdast(caption).children : node.children, title });
|
|
65172
|
+
const { alt = '', align, border, caption, height, title = null, width, src, } = getAttrs(node);
|
|
65173
|
+
const attrs = Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign({}, (align && { align })), (border && { border })), (src && { src })), (width && { width })), (height && { height })), { alt, children: caption ? lib_mdast(caption).children : node.children, title });
|
|
65174
65174
|
const mdNode = Object.assign(Object.assign({}, attrs), { position, type: NodeTypes.imageBlock, data: {
|
|
65175
65175
|
hName: 'img',
|
|
65176
65176
|
hProperties: attrs,
|
|
@@ -65277,7 +65277,7 @@ const readmeComponents = (opts) => () => tree => {
|
|
|
65277
65277
|
|
|
65278
65278
|
|
|
65279
65279
|
|
|
65280
|
-
const imageAttrs = ['align', 'alt', 'caption', 'border', 'src', 'title', 'width', 'lazy', 'className'];
|
|
65280
|
+
const imageAttrs = ['align', 'alt', 'caption', 'border', 'height', 'src', 'title', 'width', 'lazy', 'className'];
|
|
65281
65281
|
const readmeToMdx = () => tree => {
|
|
65282
65282
|
// Unwrap pinned nodes, replace rdme-pin with its child node
|
|
65283
65283
|
visit(tree, 'rdme-pin', (node, i, parent) => {
|
|
@@ -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(image, imageAttrs),
|
|
65300
|
+
attributes: toAttributes(Object.assign(Object.assign({}, image), { src: image.src || image.url }), imageAttrs),
|
|
65301
65301
|
children: caption.children,
|
|
65302
65302
|
});
|
|
65303
65303
|
});
|
package/dist/main.node.js
CHANGED
|
@@ -66156,8 +66156,8 @@ const coerceJsxToMd = ({ components = {}, html = false } = {}) => (node, index,
|
|
|
66156
66156
|
}
|
|
66157
66157
|
else if (node.name === 'Image') {
|
|
66158
66158
|
const { position } = node;
|
|
66159
|
-
const { alt = '', align, border, caption, title = null, width, src, } = getAttrs(node);
|
|
66160
|
-
const attrs = Object.assign(Object.assign(Object.assign(Object.assign(Object.assign({}, (align && { align })), (border && { border })), (src && { src })), (width && { width })), { alt, children: caption ? lib_mdast(caption).children : node.children, title });
|
|
66159
|
+
const { alt = '', align, border, caption, height, title = null, width, src, } = getAttrs(node);
|
|
66160
|
+
const attrs = Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign({}, (align && { align })), (border && { border })), (src && { src })), (width && { width })), (height && { height })), { alt, children: caption ? lib_mdast(caption).children : node.children, title });
|
|
66161
66161
|
const mdNode = Object.assign(Object.assign({}, attrs), { position, type: NodeTypes.imageBlock, data: {
|
|
66162
66162
|
hName: 'img',
|
|
66163
66163
|
hProperties: attrs,
|
|
@@ -66264,7 +66264,7 @@ const readmeComponents = (opts) => () => tree => {
|
|
|
66264
66264
|
|
|
66265
66265
|
|
|
66266
66266
|
|
|
66267
|
-
const imageAttrs = ['align', 'alt', 'caption', 'border', 'src', 'title', 'width', 'lazy', 'className'];
|
|
66267
|
+
const imageAttrs = ['align', 'alt', 'caption', 'border', 'height', 'src', 'title', 'width', 'lazy', 'className'];
|
|
66268
66268
|
const readmeToMdx = () => tree => {
|
|
66269
66269
|
// Unwrap pinned nodes, replace rdme-pin with its child node
|
|
66270
66270
|
visit(tree, 'rdme-pin', (node, i, parent) => {
|
|
@@ -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(image, imageAttrs),
|
|
66287
|
+
attributes: toAttributes(Object.assign(Object.assign({}, image), { src: image.src || image.url }), imageAttrs),
|
|
66288
66288
|
children: caption.children,
|
|
66289
66289
|
});
|
|
66290
66290
|
});
|
package/package.json
CHANGED