Resolved parser and formatting error

There has been a parser error in some common formatting when formatData
wasnt trimmed correctly. Also closing open tags to early has been
resolved.

The formatter did not correctly set previous set styles onto text which
still apply after closing an embedded tag, this has been resolved.

Source5.txt updated to reflect this change.