Created
August 11, 2017 05:33
-
-
Save tmocellin/1953449987a5c38a1d760f81204c1a50 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
var cWrap=$('<pre>'); | |
$('.w-richtext h6').each(function(){ | |
var o = $(this).next('h6').length; | |
console.log(o); | |
$(this).replaceWith(cWrap).appendTo(cWrap); | |
if (!o) cWrap=$('<pre />'); | |
}); | |
$('pre h6').replaceWith(function(){ | |
return $("<span />", {html: $(this).html()}); | |
}); | |
$("pre span").css("display","block"); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment