Flattening the content of the edit state as text