Fixed #4 (proper slicing for HTML previews)