All the bold text, italics, and headings would need to be saved in a database column to be retrieved later in their correct positions.
Nobody does that. People simply store HTML, Markdown or BB code. Check out TinyMCE, Milkdown, tui-editor, stackedit... all of them have a "see source" button and you'll see the text with the formatting code right there.