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
a123742c
Commit
a123742c
authored
Apr 17, 2026
by
Яков
Browse files
update
parent
82b42d2a
Pipeline
#9940
failed with stages
in 0 seconds
Changes
2
Pipelines
1
Show whitespace changes
Inline
Side-by-side
package.json
View file @
a123742c
{
{
"name"
:
"react-ag-qeditor"
,
"name"
:
"react-ag-qeditor"
,
"version"
:
"1.1.3
4
"
,
"version"
:
"1.1.3
5
"
,
"description"
:
"WYSIWYG html editor"
,
"description"
:
"WYSIWYG html editor"
,
"author"
:
"atma"
,
"author"
:
"atma"
,
"license"
:
"
MIT
"
,
"license"
:
"
MIT
"
,
...
...
src/extensions/DragAndDrop.js
View file @
a123742c
...
@@ -103,8 +103,9 @@ export const DragAndDrop = Extension.create({
...
@@ -103,8 +103,9 @@ export const DragAndDrop = Extension.create({
const
fl
=
(
style
.
match
(
/float
\s
*:
\s
*
([^
;
]
+
)
/i
)
||
[])[
1
]?.
trim
();
const
fl
=
(
style
.
match
(
/float
\s
*:
\s
*
([^
;
]
+
)
/i
)
||
[])[
1
]?.
trim
();
if
(
ml
===
'
auto
'
&&
mr
===
'
auto
'
)
result
.
align
=
'
center
'
;
if
(
ml
===
'
auto
'
&&
mr
===
'
auto
'
)
result
.
align
=
'
center
'
;
else
if
(
fl
===
'
right
'
||
ml
===
'
auto
'
)
result
.
align
=
'
right
'
;
else
if
(
fl
===
'
right
'
)
result
.
align
=
'
right
'
;
else
result
.
align
=
'
left
'
;
else
if
(
fl
===
'
left
'
)
result
.
align
=
'
left
'
;
else
result
.
align
=
'
center
'
;
// нет float → блочный элемент
return
result
;
return
result
;
}
catch
{
}
catch
{
...
@@ -284,12 +285,15 @@ export const DragAndDrop = Extension.create({
...
@@ -284,12 +285,15 @@ export const DragAndDrop = Extension.create({
const
upload
=
uploads
[
i
];
const
upload
=
uploads
[
i
];
if
(
upload
)
{
if
(
upload
)
{
img
.
setAttribute
(
'
src
'
,
upload
.
filePath
);
img
.
setAttribute
(
'
src
'
,
upload
.
filePath
);
//
Сохраняем data-align для parseHTML Image.jsx
//
Определяем выравнивание из inline-стилей картинки
const
ml
=
(
upload
.
style
.
match
(
/margin-left
\s
*:
\s
*
([^
;
]
+
)
/i
)
||
[])[
1
]?.
trim
();
const
ml
=
(
upload
.
style
.
match
(
/margin-left
\s
*:
\s
*
([^
;
]
+
)
/i
)
||
[])[
1
]?.
trim
();
const
mr
=
(
upload
.
style
.
match
(
/margin-right
\s
*:
\s
*
([^
;
]
+
)
/i
)
||
[])[
1
]?.
trim
();
const
mr
=
(
upload
.
style
.
match
(
/margin-right
\s
*:
\s
*
([^
;
]
+
)
/i
)
||
[])[
1
]?.
trim
();
const
fl
=
(
upload
.
style
.
match
(
/float
\s
*:
\s
*
([^
;
]
+
)
/i
)
||
[])[
1
]?.
trim
();
const
fl
=
(
upload
.
style
.
match
(
/float
\s
*:
\s
*
([^
;
]
+
)
/i
)
||
[])[
1
]?.
trim
();
// Нет float → блочный элемент → center; есть float → left/right
const
align
=
(
ml
===
'
auto
'
&&
mr
===
'
auto
'
)
?
'
center
'
const
align
=
(
ml
===
'
auto
'
&&
mr
===
'
auto
'
)
?
'
center
'
:
(
fl
===
'
right
'
||
ml
===
'
auto
'
)
?
'
right
'
:
'
left
'
;
:
fl
===
'
right
'
?
'
right
'
:
fl
===
'
left
'
?
'
left
'
:
'
center
'
;
// Google Docs / большинство источников — блок без float
img
.
setAttribute
(
'
data-align
'
,
align
);
img
.
setAttribute
(
'
data-align
'
,
align
);
if
(
upload
.
width
)
img
.
setAttribute
(
'
width
'
,
String
(
upload
.
width
));
if
(
upload
.
width
)
img
.
setAttribute
(
'
width
'
,
String
(
upload
.
width
));
if
(
upload
.
height
)
img
.
setAttribute
(
'
height
'
,
String
(
upload
.
height
));
if
(
upload
.
height
)
img
.
setAttribute
(
'
height
'
,
String
(
upload
.
height
));
...
...
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