@mdxeditor/editor 3.52.4 → 3.52.5

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.
@@ -10,7 +10,7 @@ import { ImageEditor } from "./ImageEditor.js";
10
10
  function convertImageElement(domNode) {
11
11
  if (domNode instanceof HTMLImageElement) {
12
12
  const { alt: altText, src, title, width, height } = domNode;
13
- const node = $createImageNode({ altText, src, title, width, height });
13
+ const node = $createImageNode({ altText, src, title, width: width || void 0, height: height || void 0 });
14
14
  return { node };
15
15
  }
16
16
  return null;
@@ -80,10 +80,10 @@ class ImageNode extends DecoratorNode {
80
80
  if (this.__title) {
81
81
  element.setAttribute("title", this.__title);
82
82
  }
83
- if (this.__width) {
83
+ if (this.__width !== "inherit" && this.__width) {
84
84
  element.setAttribute("width", this.__width.toString());
85
85
  }
86
- if (this.__height) {
86
+ if (this.__height !== "inherit" && this.__height) {
87
87
  element.setAttribute("height", this.__height.toString());
88
88
  }
89
89
  return { element };
@@ -102,8 +102,8 @@ class ImageNode extends DecoratorNode {
102
102
  return {
103
103
  altText: this.getAltText(),
104
104
  title: this.getTitle(),
105
- height: this.__height === "inherit" ? 0 : this.__height,
106
- width: this.__width === "inherit" ? 0 : this.__width,
105
+ height: this.__height === "inherit" ? void 0 : this.__height,
106
+ width: this.__width === "inherit" ? void 0 : this.__width,
107
107
  src: this.getSrc(),
108
108
  rest: this.__rest,
109
109
  type: "image",
@@ -32,8 +32,8 @@ const MdastHtmlImageVisitor = {
32
32
  src: src || "",
33
33
  altText,
34
34
  title,
35
- width,
36
- height
35
+ width: width || void 0,
36
+ height: height || void 0
37
37
  });
38
38
  if (lexicalParent.getType() === "root") {
39
39
  const paragraph = $createParagraphNode();
package/package.json CHANGED
@@ -11,7 +11,7 @@
11
11
  "*.css"
12
12
  ],
13
13
  "type": "module",
14
- "version": "3.52.4",
14
+ "version": "3.52.5",
15
15
  "description": "React component for rich text markdown editing",
16
16
  "scripts": {
17
17
  "build": "vite build",