Skip to content

Commit 89df65c

Browse files
committed
fix: Copy content avoids multiple consecutive newlines
1 parent 9331690 commit 89df65c

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

ui/src/components/Editor/ToolBars/image.tsx

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -285,6 +285,10 @@ const Image = ({ editorInstance }) => {
285285

286286
traverse(body);
287287

288+
markdownText = markdownText.replace(/[\n\s]+/g, (match) => {
289+
return match.length > 1 ? '\n\n' : match;
290+
});
291+
288292
editor.replaceSelection(markdownText);
289293
};
290294
const handleClick = () => {

0 commit comments

Comments
 (0)