title: CodeMirror how to replace marked text without removing mark
body: <p>I am adding a css style to all occurrences of a given word in a text-box using CodeMirror .
  editor.markText(s, e, "cssClass");</p>
  
  <p>But I would like to replace the words at the same time.</p>
  
  <p>I have tried:</p>
  
  <p>editor.replaceRange("new words", s, e); 
  but this removes the marks as well.</p>
  
  <p>I could use jquery $(".cssClass").text("new Words");</p>
  
  <p>but I am worried this would mess up CodeMirror internally if it holds outdated versions of the text.</p>
  
  <p>Any ideas?</p>