@kaitify/vue 0.0.4-beta.23 → 0.0.4-beta.25

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.
@@ -2731,7 +2731,6 @@ const handlerForPasteDrop = async function(dataTransfer) {
2731
2731
  const html = dataTransfer.getData("text/html");
2732
2732
  const text2 = dataTransfer.getData("text/plain");
2733
2733
  const files = dataTransfer.files;
2734
- debugger;
2735
2734
  if (files.length && this.priorityPasteFiles) {
2736
2735
  await handlerForPasteFiles.apply(this, [files]);
2737
2736
  } else if (html && this.allowPasteHtml && !this.selection.start.node.isInCodeBlockStyle()) {
@@ -2923,7 +2922,20 @@ const formatPlaceholderMerge = ({ editor, node }) => {
2923
2922
  };
2924
2923
  const formatLineBreakSpaceText = ({ editor, node }) => {
2925
2924
  if (node.isText() && !node.isEmpty()) {
2926
- node.textContent = node.textContent.replace(/\r\n/g, "\n").replace(/\u00A0/g, " ").replace(/\uFEFF/g, getZeroWidthText());
2925
+ const originalText = node.textContent;
2926
+ node.textContent = originalText.replace(/\r\n/g, "\n").replace(/\u00A0/g, " ").replace(/\uFEFF/g, getZeroWidthText());
2927
+ if (editor.selection.focused()) {
2928
+ if (editor.selection.start.node.isEqual(node)) {
2929
+ const preText = originalText.slice(0, editor.selection.start.offset);
2930
+ const crlfCount = (preText.match(/\r\n/g) || []).length;
2931
+ editor.selection.start.offset -= crlfCount;
2932
+ }
2933
+ if (editor.selection.end.node.isEqual(node)) {
2934
+ const preText = originalText.slice(0, editor.selection.end.offset);
2935
+ const crlfCount = (preText.match(/\r\n/g) || []).length;
2936
+ editor.selection.end.offset -= crlfCount;
2937
+ }
2938
+ }
2927
2939
  let startPrevNumber = 0;
2928
2940
  let endPrevNumber = 0;
2929
2941
  const regExp = new RegExp(`\\n(?!${getZeroWidthText()})`, "g");