Snip formatting for documents causing serious lag

This fixes extreme lag on long documents as discussed in issue #9