boolean inconsistent = true;
if (EditorTestingUtil.isConsistent(editor)) {
if (editor instanceof EditorImpl) {
// specialise for editor impls to have the behaviour of the document but no selection
// if the editor is not consistent.
EditorImpl ed = (EditorImpl)editor;
Point<ContentNode> selStart = null;
Point<ContentNode> selEnd = null;
PointRange<Node> seln = ed.getOrderedHtmlSelection();
try {
selStart = seln == null ? null :
ed.getNodeManager().nodeletPointToWrapperPoint(seln.getFirst());
selEnd = seln == null ? null :
ed.getNodeManager().nodeletPointToWrapperPoint(seln.getSecond());
return new Pretty<ContentNode>().select(selStart, selEnd).print(
editor.getContent().getFullContentView());
} catch (HtmlInserted e) {
// fall through to error case
} catch (HtmlMissing e) {