Increased safety of parser when dealing with invalid template strings