- 
      
- 
        Save DarrylErentzen/766efac71cb32af539c8aa269a973feb to your computer and use it in GitHub Desktop. 
    Cleanup WordPress
  
        
  
    
      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 cleanup () { | |
| var textContent = jQuery('.wp-editor-area').val(); | |
| textContent = textContent | |
| .replace(/(\<center\>)(["a-z,.!?':;@£$%=\[\]{}^&*()_”“–—‘’\-\+0-9 \n]*)(\<\/center\>)/ig, "<blockquote>$2</blockquote>") | |
| .replace(/(\<img.+\/\>)/g, "\n\n") | |
| .replace(/(\<i\>)(.*)(\<\/i\>)/g, "<em>$2</em>") | |
| .replace(/(\<b\>)(.*)(\<\/b\>)/g, "<strong>$2</strong>"); | |
| jQuery('.wp-editor-area').val(textContent); | |
| }; | 
  
    Sign up for free
    to join this conversation on GitHub.
    Already have an account?
    Sign in to comment