Browse Source

Revert the previous fix for apostrophes

It doesn't cover all the cases. There's a simpler and better fix.

This reverts commit 803a814025.
Yevhen Pavliuk 8 years ago
parent
commit
9d1f327e76
1 changed files with 4 additions and 9 deletions
  1. 4
    9
      src/RichTextEditor.js

+ 4
- 9
src/RichTextEditor.js View File

@@ -113,8 +113,8 @@ export default class RichTextEditor extends Component {
113 113
           }
114 114
           this.setTitlePlaceholder(this.props.titlePlaceholder);
115 115
           this.setContentPlaceholder(this.props.contentPlaceholder);
116
-          this.setTitleHTML(this.htmlEcodeString(this.props.initialTitleHTML));
117
-          this.setContentHTML(this.htmlEcodeString(this.props.initialContentHTML));
116
+          this.setTitleHTML(this.props.initialTitleHTML);
117
+          this.setContentHTML(this.props.initialContentHTML);
118 118
           this.props.editorInitializedCallback && this.props.editorInitializedCallback();
119 119
 
120 120
           break;
@@ -254,12 +254,6 @@ export default class RichTextEditor extends Component {
254 254
       .replace(/[\t]/g, '\\t');
255 255
   };
256 256
 
257
-  htmlEcodeString = function (string) {
258
-    //for some reason there's an issue only with apostrophes
259
-    return string
260
-      .replace(/'/g, ''');
261
-  }
262
-
263 257
   _sendAction(action, data) {
264 258
     let jsonString = JSON.stringify({type: action, data});
265 259
     jsonString = this.escapeJSONString(jsonString);
@@ -374,7 +368,8 @@ export default class RichTextEditor extends Component {
374 368
   }
375 369
 
376 370
   insertLink(url, title) {
377
-    this._sendAction(actions.insertLink, {url, title: this.htmlEcodeString(title)});
371
+
372
+    this._sendAction(actions.insertLink, {url, title});
378 373
   }
379 374
 
380 375
   insertImage(url, alt) {