Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
lib
react-ag-qeditor
Commits
c36835e4
Commit
c36835e4
authored
Jul 04, 2025
by
Яков
Browse files
fix
parent
b22d9645
Changes
2
Hide whitespace changes
Inline
Side-by-side
package.json
View file @
c36835e4
{
{
"name"
:
"react-ag-qeditor"
,
"name"
:
"react-ag-qeditor"
,
"version"
:
"1.
0.10
0"
,
"version"
:
"1.
1.
0"
,
"description"
:
"WYSIWYG html editor"
,
"description"
:
"WYSIWYG html editor"
,
"author"
:
"atma"
,
"author"
:
"atma"
,
"license"
:
"
MIT
"
,
"license"
:
"
MIT
"
,
...
...
src/extensions/Image.jsx
View file @
c36835e4
...
@@ -102,19 +102,10 @@ const ResizableImageTemplate = ({ node, updateAttributes, editor, getPos, select
...
@@ -102,19 +102,10 @@ const ResizableImageTemplate = ({ node, updateAttributes, editor, getPos, select
const
initImageSize
=
()
=>
{
const
initImageSize
=
()
=>
{
try
{
try
{
// Если размеры уже заданы в атрибутах - используем их
// Если размеры уже заданы в атрибутах - используем их
if
(
node
.
attrs
.
width
&&
node
.
attrs
.
height
)
{
safeUpdateAttributes
({
width
:
node
.
attrs
.
width
,
height
:
node
.
attrs
.
height
,
'
data-node-id
'
:
node
.
attrs
[
'
data-node-id
'
]
||
`img-
${
Date
.
now
()}
-
${
Math
.
random
().
toString
(
36
).
substr
(
2
,
9
)}
`
});
isInitialized
.
current
=
true
;
return
;
}
const
{
width
:
editorWidth
}
=
getEditorDimensions
();
const
{
width
:
editorWidth
}
=
getEditorDimensions
();
const
naturalWidth
=
imgRef
.
current
.
naturalWidth
;
const
naturalWidth
=
node
.
attrs
.
width
||
imgRef
.
current
.
naturalWidth
;
const
naturalHeight
=
imgRef
.
current
.
naturalHeight
;
const
naturalHeight
=
node
.
attrs
.
height
||
imgRef
.
current
.
naturalHeight
;
if
(
naturalWidth
<=
0
||
naturalHeight
<=
0
)
{
if
(
naturalWidth
<=
0
||
naturalHeight
<=
0
)
{
console
.
warn
(
'
Image has invalid natural dimensions, retrying...
'
);
console
.
warn
(
'
Image has invalid natural dimensions, retrying...
'
);
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment