Allow text attachments to be associated with DOM classes

One issue I encountered was the need to associate a text attachment with a particular class of <div>s. This slightly shoddy hack makes that possible.