Skip to content

Commit

Permalink
Change the order of encoding.
Browse files Browse the repository at this point in the history
  • Loading branch information
mmotyczynska committed Oct 24, 2023
1 parent 93805cb commit 42f8906
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions packages/ckeditor5-clipboard/src/utils/plaintexttohtml.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,11 +15,11 @@
*/
export default function plainTextToHtml( text: string ): string {
text = text
// Encode &.
.replace( /&/g, '&' )
// Encode <>.
.replace( /</g, '&lt;' )
.replace( />/g, '&gt;' )
// Encode &.
.replace( /&/g, '&amp;' )
// Creates a paragraph for each double line break.
.replace( /\r?\n\r?\n/g, '</p><p>' )
// Creates a line break for each single line break.
Expand Down

0 comments on commit 42f8906

Please sign in to comment.