Added support for formatting from bom - fixes #8