Correcting document type generation because . , _ # and | are not allowed.