def to_html_citation
span = xelem('span')
span['class'] = 'maruku-citation'
span << xtext('[')
self.cites.each do |c|
if c =~ /(\w+):(\d\d\d\d\w{2,3})/
a = xelem('a')
a << xtext(c)
a['href'] = "http://inspirehep.net/search?p=#{$1}%3A#{$2}"
span << a << xtext(',')
elsif c =~ /MR(\d+)/
a = xelem('a')
a << xtext(c)
a['href'] = "http://www.ams.org/mathscinet-getitem?mr=#{$1}"
span << a << xtext(',')
else
span << xtext(c + ',')
end
end
span.children.last.chop! unless span.children.last == '['
span << xtext(']')
span
end