make span not self closing when no children
use data-media-type instead of data-mime-type