The disclosure is directed to a rich text editor (“editor”) that facilitates generation and manipulation of rich text content. The editor can be integrated into an application, e.g., a social networking application, to support rich text content creation in the application. The application renders a document containing rich text content using a document object model (DOM). The editor stores a state of the document, e.g., features such as formatting style of content, separate from the DOM, thereby eliminating and/or minimizing any inconsistencies that can be caused due to storing the state with the DOM. The editor stores the content as multiple data blocks and the state as multiple feature data objects. A rendering component of the text editor renders the document by outputting the document into the DOM using the data blocks and the feature data objects. The rendering component includes APIs for rendering the document in various formatting styles.
展开▼