added formatBlock method of formatting text using a custom block on each change
updated sample project to use the block method