formatting: handle templates spans
added more tests
Merge pull request #1167 from Microsoft/formatting_templates

formatting: handle templates spans