Created
June 19, 2019 11:49
-
-
Save tkc49/0314d486d58bf0745fb6c2b231743427 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(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