client/src/components/SlateEditor.js
changeset 15 4a8bbd314a46
parent 12 48ddaa42b810
child 16 e67cd18cc594
equal deleted inserted replaced
14:df6780e48eb5 15:4a8bbd314a46
     1 import { Editor, Plain } from 'slate'
     1 import { Editor, Plain, Raw } from 'slate'
     2 import React from 'react'
     2 import React from 'react'
     3 
     3 
     4 /**
     4 /**
     5  * Define the default node type.
     5  * Define the default node type.
     6  */
     6  */
   104 
   104 
   105   asPlain = () => {
   105   asPlain = () => {
   106     return Plain.serialize(this.state.state);
   106     return Plain.serialize(this.state.state);
   107   }
   107   }
   108 
   108 
       
   109   asRaw = () => {
       
   110     return Raw.serialize(this.state.state);
       
   111   }
       
   112 
   109   clear = () => {
   113   clear = () => {
   110     const state = Plain.deserialize('');
   114     const state = Plain.deserialize('');
   111     this.onChange(state);
   115     this.onChange(state);
   112   }
   116   }
   113 
   117