title: How to fix string saving as code to word?
body: <p>I have the following code:</p>
  <pre><code>function downloadNotes() {
    var information = document.getElementById(&quot;text&quot;).innerHTML;
    var textToBLOB = new Blob([information], { type: 'text/plain' });
    var sFileName = 'formData = document.doc';
  
    var newLink = document.createElement(&quot;a&quot;);
  
       newLink.download = sFileName;
  
   if (window.webkitURL != null) {
       newLink.href = window.webkitURL.createObjectURL(textToBLOB);
   }
   else {
       newLink.href = window.URL.createObjectURL(textToBLOB);
       newLink.style.display = &quot;none&quot;;
       document.body.appendChild(newLink);
   }
  
       newLink.click();
  }
  </code></pre>
  <p>When I save my notes, it successfully saves it to word, but when I open it, it shows the code all compressed rather than the string output:
  <a href="https://i.stack.imgur.com/QHd7F.png" rel="nofollow noreferrer">Here.</a></p>