More complete implementation of text doc type.