title: How can I convert RTF to plain text in JavaScript (removing images and styling)?
body: <p>I am trying to remove all RTF formatting from a document but when I do so it seems to keep images and styling (i.e. the Fonts etc.)</p>
  <p>Here is my Code:</p>
  <pre><code>    function convertToPlain(rtf) {
      rtf = rtf.replace(/\\par[d]?/g, &quot;&quot;);
      return rtf.replace(/\{\*?\\[^{}]+}|[{}]|\\\n?[A-Za-z]+\n?(?:-?\d+)?[ ]?/g, &quot;&quot;).replace(/^\s\s*/, '').replace(/\s\s*$/, '');
  }
  
  var body = input[0].text.toString();
  
  var content = convertToPlain(body.toString());  
  var rq = &lt;Test&gt;{content}&lt;/Test&gt;
  next.xml = rq;
  </code></pre>
  <p>This does remove the RTF formatting but keeps all images and styling within the result.</p>
  <p>Does anyone know how to remove the images and styling aswell?</p>
  <p>Thanks</p>