You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When the string serialized by the serializeHtml() function contains img tags, there will be an inline style width:0 on a parent element of the tag. However, this style will cause the image to be displayed too small.
I use the onContentUpdate function to save data to the database. The raw variable is the original state of the editor, and the html variable is the serialized string of the editor content, which is used to display directly on the page. The data in raw can be used to restore the editor state normally after being read from the API, but the img elements in the serialized html have incorrect inline styles, which causes the images to be displayed too small.
When I serialize the editor state to HTML, the value of nodeWidth is the width of the element, or 100% if I have not resize the element, but
useResizableStore always create store with default width value 0, in server rendering, useEffect won't fire. so 0 is the final value get render to static string
To summarize, when I call serializeHtml, and serializeHtml calls renderToStaticMarkup, the rendered image width will always be 0.
Description
When the string serialized by the
serializeHtml()
function contains img tags, there will be an inline style width:0 on a parent element of the tag. However, this style will cause the image to be displayed too small.Steps to Reproduce
I use the onContentUpdate function to save data to the database. The raw variable is the original state of the editor, and the html variable is the serialized string of the editor content, which is used to display directly on the page. The data in raw can be used to restore the editor state normally after being read from the API, but the img elements in the serialized html have incorrect inline styles, which causes the images to be displayed too small.
Sandbox
Expected Behavior
The size of images edited in the editor should be the same as the size displayed on the page.
Environment
Bounty
Click here to add a bounty via Algora.
Funding
The text was updated successfully, but these errors were encountered: