title: How retrieve text from draftjs
body: <p>I'm trying to edit a text and then retrieve it and update the database on the server side</p>
  
  <p>this is the code I'm using</p>
  
  <pre><code>constructor(props,context){
      super(props,context);
      this.handleOnClick = this.handleOnClick.bind(this);
  
      const processedHTML = DraftPasteProcessor.processHTML(this.props.rule.description.replace(/\n/g, "&lt;br /&gt;"));
      const contentState = ContentState.createFromBlockArray(processedHTML); 
      var editorState = EditorState.createWithContent(contentState);
      var editorState = EditorState.moveFocusToEnd(editorState);
      this.state = {editorState: editorState};
      this.onChange = (editorState) =&gt; this.setState({editorState});
  }
  
  
  
  handleOnClick(event) {
     var text = this.state.editorState.getCurrentContent().getBlocksAsArray();
     var finalText;
     text.map((item) =&gt; {
     finalText = item.getText() + finalText});
     console.log(finalText)
  
    render(){
  
      return(
      &lt;div&gt;
      &lt;Col smOffset={2} mdOffset={1}&gt;
      &lt;PageHeader&gt;
          {this.props.rule.title}
      &lt;/PageHeader&gt;
      &lt;Editor
        editorState={this.state.editorState}
        onChange={this.onChange}
      /&gt;
      &lt;/Col&gt;
  
       &lt;Col smOffset={2} mdOffset={1}&gt;
      &lt;Button onClick = {this.handleOnClick()}&gt;Update rule&lt;/Button&gt;
      &lt;/Col&gt;
      &lt;/div&gt;
      );
  
  }
  </code></pre>
  
  <p>But I'm having a problem, draftJs returns the text without the \n so I'd save the text badly formatted, is there any way to get the text with breaklines?</p>