Stories/or/snippet preview

Fixes https://www.pivotaltracker.com/story/show/78992008

@jdevalk could you please review?
this function needs PHPdoc.