Skip to content

Commit

Permalink
Make both regexes literal
Browse files Browse the repository at this point in the history
  • Loading branch information
getdave committed Aug 12, 2021
1 parent 838ce44 commit 6a0db13
Showing 1 changed file with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -234,8 +234,8 @@ export function usePasteHandler( props ) {
* @return {string} the normalized html
*/
function removeWindowsFragments( html ) {
const startReg = new RegExp( '.*<!--StartFragment-->', 's' );
const endReg = new RegExp( '<!--EndFragment-->.*', 's' );
const startReg = /.*<!--StartFragment-->/s;
const endReg = /<!--EndFragment-->.*/s;

return html.replace( startReg, '' ).replace( endReg, '' );
}

0 comments on commit 6a0db13

Please sign in to comment.