Skip to main content
(References to relative positions of answers are not reliable as it depends on the view (votes/newest/active) and changing of the accepted answer and change over time (for votes, active, and accepted state)).
Source Link
Peter Mortensen
  • 31.4k
  • 22
  • 110
  • 134

I would go with this:

$('body').html($('body').html().replace(/<br\W?\\?>(\W?(<br\W?\\?>)+)+/g,"<br>")); 

However, after reading the comments abovein another post here I do consider that you should try to avoid doing this in case you can correct it in the back end.

Cheers

I would go with this:

$('body').html($('body').html().replace(/<br\W?\\?>(\W?(<br\W?\\?>)+)+/g,"<br>")); 

However, after reading the comments above I do consider that you should try to avoid doing this in case you can correct it in the back end.

Cheers

I would go with this:

$('body').html($('body').html().replace(/<br\W?\\?>(\W?(<br\W?\\?>)+)+/g,"<br>")); 

However, after reading the comments in another post here I do consider that you should try to avoid doing this in case you can correct it in the back end.

Source Link
Jair Reina
  • 2.9k
  • 27
  • 22

I would go with this:

$('body').html($('body').html().replace(/<br\W?\\?>(\W?(<br\W?\\?>)+)+/g,"<br>")); 

However, after reading the comments above I do consider that you should try to avoid doing this in case you can correct it in the back end.

Cheers