Skip to content

Commit

Permalink
Insert new paragraph instead of line break on new line (#7)
Browse files Browse the repository at this point in the history
  • Loading branch information
curdopet authored Jul 31, 2024
1 parent 63cf99e commit dbfabf7
Showing 1 changed file with 1 addition and 5 deletions.
6 changes: 1 addition & 5 deletions modules/tinymce/src/core/main/ts/paste/Newlines.ts
Original file line number Diff line number Diff line change
Expand Up @@ -25,14 +25,10 @@ const openContainer = (rootTag: string, rootAttrs: Record<string, string>): stri
};

const toBlockElements = (text: string, rootTag: string, rootAttrs: Record<string, string>): string => {
const blocks = text.split(/\n\n/);
const paragraphs = text.split(/\n/);
const tagOpen = openContainer(rootTag, rootAttrs);
const tagClose = '</' + rootTag + '>';

const paragraphs = Arr.map(blocks, (p) => {
return p.split(/\n/).join('<br />');
});

const stitch = (p: string): string => {
return tagOpen + p + tagClose;
};
Expand Down

0 comments on commit dbfabf7

Please sign in to comment.