@register.simple_tag<EOL>def data_attrs(mapitem):
data_attrs = {}<EOL>try:<EOL><INDENT>data_attrs['<STR_LIT>'] = reverse('<STR_LIT>')<EOL><DEDENT>except NoReverseMatch:<EOL><INDENT>pass<EOL><DEDENT>data_attrs.update(mapitem.get_map_options())<EOL>return mark_safe(u'<STR_LIT>'.join([<EOL>format_html(u'<STR_LIT>', k.replace('<STR_LIT:_>', '<STR_LIT:->'), _data_value(v))<EOL>for k, v in data_attrs.items()<EOL>]))<EOL>
Generate the data-... attributes for a mapitem.