title: tinyMCE - limit  RemoveFormat to a list of formats
body: <p>Current tinyMCE version (3.5.2).</p>
  
  <p>Hi,</p>
  
  <p>I am working on a custom plugin which adds and removes <a href="http://www.tinymce.com/tryit/custom_formats.php" rel="nofollow">custom formats</a>.</p>
  
  <p>Adding a format to the current selection is simple however I couldn't
  find a fitting solution for removing multiple formats.</p>
  
  <p>What I did find was the RemoveFormat command:</p>
  
  <pre><code>tinymce.activeEditor.execCommand('RemoveFormat');
  // which is the same as 
  tinymce.activeEditor.formatter.remove('removeformat');
  </code></pre>
  
  <p>This function does remove any formats of the current selection
  and that is definitely to much as I want to remove only some of the formats.</p>
  
  <p>So I tried to call the <code>remove</code> method for every format</p>
  
  <pre><code>tinymce.activeEditor.formatter.remove('format_1');
  tinymce.activeEditor.formatter.remove('format_2');
  ...
  </code></pre>
  
  <p>However this wasn't successful either as it doesn't remove nested formats.
  If you select the following paragraph and call <code>tinymce.activeEditor.formatter.remove('format_2');</code> it will <strong>NOT</strong> remove the format as the paragraph doesn't use this format itself.</p>
  
  <pre><code>&lt;p class="format_1"&gt;abcd&lt;span class="format_2&gt;ef&lt;/span&gt;g&lt;/p&gt;
  </code></pre>
  
  <p>Is there any way to <strong>remove a format of an element and also of all of its children</strong> like RemoveFormat?</p>
  
  <hr>
  
  <p>Update (@Thariama)</p>
  
  <p>All my formats are custom formats with the following structure:</p>
  
  <pre><code>  "demo_format_1" : { 
        "classes" : "demo_format_1",
        "deep" : true,
        "exact" : false,
        "inline" : "span",
        "selector" : "*",
        "title" : "Demo Format"
     }}
  </code></pre>
  
  <hr>
  
  <p>Update: </p>
  
  <p>After implementing this again I found further cases.
  Here are examples of all special cases which came to my mind:</p>
  
  <p>Text before removing the format:</p>
  
  <pre><code>&lt;p&gt;abc&lt;span class=demo_format_1&gt;def&lt;/span&gt;&lt;/p&gt;
  </code></pre>
  
  <p>Case 1 (Covered with the so Jeffery To)</p>
  
  <p>Selecting the whole paragraph should give you the following result</p>
  
  <pre><code> &lt;p&gt;abcdef&lt;/p&gt;
  </code></pre>
  
  <p>Case 2</p>
  
  <p>Selecting only f should give you the following result</p>
  
  <pre><code>&lt;p&gt;abc&lt;span class=demo_format_1&gt;de&lt;/span&gt;f&lt;/p&gt;
  </code></pre>
  
  <p>Case 3</p>
  
  <p>Selecting only cd should give you the following result</p>
  
  <pre><code>&lt;p&gt;abcd&lt;span class=demo_format_1&gt;ef&lt;/span&gt;&lt;/p&gt;
  </code></pre>