Formatting structured text

This code is about presentation of bidirectional structured text. It is the text that have segments, which should be shown with different base text direction or segments, which should appear in some predetermined sequence. The simplest examples is file path: names of directories, file name and file extension should follow each other from left to right. Formatted 'as is' by Unicode Bidi Algorithm, such text may become unreadable.
Current solution uses UCC (this functionality was partially implemented in dojox/string/BidiComplex) and will be extended by HTML presentation.