var sel = window.getSelection();
var range = sel.getRangeAt(0);
var content = range.toString();
Editing my post:
Experimenting a bit, I find that
sel.toString() returns new lines in contenteditable divs, while
range.toString() returns newlines correctly in normal non-editable divs, but not in editable ones, as you reported.
Could not find any explanation for the behaviour though.
This is a useful link http://www.quirksmode.org/dom/range_intro.html