Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save tkc49/0314d486d58bf0745fb6c2b231743427 to your computer and use it in GitHub Desktop.
Save tkc49/0314d486d58bf0745fb6c2b231743427 to your computer and use it in GitHub Desktop.
(function ($) {
$(function () {
$('.wpsm_panel-body').each(function (index, element) {
// replace newline code to br tag
let replacedWpsmPanelBodyHtml = $(element).html().replace(/\r?\n/g, '<br>');
$(element).html(replacedWpsmPanelBodyHtml);
// remove <br> of first
$(element).find('br').each(function (index, element) {
if (index === 0) {
$(element).remove();
}
})
})
});
})(jQuery)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment