added functionality calculating html character offset for TextBlock