Skip to content

Commit

Permalink
Preserved selection marks on ost event (#91)
Browse files Browse the repository at this point in the history
  • Loading branch information
st-angelo-adobe authored Nov 14, 2024
1 parent e8a9b18 commit 89fae32
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion studio/src/rte/rte-field.js
Original file line number Diff line number Diff line change
Expand Up @@ -569,7 +569,11 @@ class RteField extends LitElement {
? state.schema.text(attributes.text)
: null;

const node = nodeType.create(mergedAttributes, content);
const node = nodeType.create(
mergedAttributes,
content,
selection.node?.marks,
);
const tr = selection.empty
? state.tr.insert(selection.from, node)
: state.tr.replaceWith(selection.from, selection.to, node);
Expand Down

0 comments on commit 89fae32

Please sign in to comment.