title: ExtJS: Xtemplate doesn't recognize special characters like /n /r
body: <p>My store record has some special characters as follows</p>
  
  <pre><code>name: "Hi \r\n\r\n Location Name: Hello\r\n\r\n"
  </code></pre>
  
  <p>But when it is displayed on UI (using XTemplate), the special characters are not displayed but not even applied. They are just discarded.</p>
  
  <p>//XTemplate</p>
  
  <pre><code>    var cars_template = new Ext.XTemplate(
  '&lt;tpl ="."&gt;',
  '&lt;div class="cars-item"&gt;',                 
  '&lt;li&gt;',
  '&lt;span&gt;Name: &lt;/span&gt;&lt;span&gt;{[this.updateHtml(values.name)]}&lt;/span&gt;',
  '&lt;/li&gt;',
  '&lt;/div&gt;&lt;/tpl&gt;',
  {
    updateHtml: function(value){
      if(value){
        value = value.replace(/(?:\r\n|\r|\n)/g, '&lt;br/&gt;');            
      }
      return value;
    }
  }
  
  ); 
  </code></pre>