guardian/scribe — pull request #7 by OliverJAsh (2013-12-18 13:34:12+00:00)
Title: Push initial history on first focus

Previously, if `Scribe.setContent` was called without a reference to a marker,
performing an undo to the original content would place the caret outside of the
P element. This is because the undo operation would not know where to restore
the user's selection to.

To get around this, we defer the first history push until the user focuses on
the editor. This mimicks the behaviour of the native undo manager — undo to the
original content will restore the user's selection where it first appeared.

This also circumvents a bug where the markers produced by the history push would
be corrupted by the sanitizer plugin (`` became `
if you had listed `em` in your sanitizer configuration).