Added text edit functionality and HTML generation