TinyMCE strips line breaks on mceAddControl
It turns out that TinyMCE has it’s own autop setting, so if you kill it before the sort and then put it back you should be good to go! Check out the autop setting handling in this snippet: <script> (function($) { // by default, wpautop will be true var wpautop = true; // this function … Read more