$book->textContent
strips all markup from the content [1], such as <div>
which are naturally inserted when you hit enter on an contenteditable
-Element. Therefore all this function returns is a concatenation of pure text.
I'm not sure what your goal is, but you might look into $your_DOMDocument->saveHTML($book)
. This will return the actual HTML of each $book
including the surrounding <div>
.
[1]: see the DOM Specifications