implemented most of the text formatting parser.