// has no effect:
cm.markText(somePt, someOtherPt, {attributes: {'data-foo': 'bar'} })
// sets class and attribute:
cm.markText(somePt, someOtherPt, {attributes: {'data-foo': 'bar'}, className: 'dummy'})
markText should set the attributes for the given range irrespective of the presence of className.