Text this: An extension of the Clark-Ocone formula