Skip to content

Commit

Permalink
Fix pasting text starting with newlines
Browse files Browse the repository at this point in the history
  • Loading branch information
Skalakid committed Jul 1, 2024
1 parent d1d8a49 commit 153ead8
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/MarkdownTextInput.web.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -266,7 +266,7 @@ const MarkdownTextInput = React.forwardRef<TextInput, MarkdownTextInputProps>(
nodeCopy.innerHTML = '\n';
}
// Replace only br tags with data-id attribute, because we know that were created by the web parser. We need to ignore tags created by contentEditable div
nodeCopy.innerHTML = nodeCopy.innerHTML.replaceAll(/<br data-id=.*?>/g, '\n');
nodeCopy.innerHTML = nodeCopy.innerHTML.replaceAll(/<br .*?>/g, '\n');
}
let nodeText = nodeCopy.textContent ?? '';

Expand Down

0 comments on commit 153ead8

Please sign in to comment.