class Kramdown::Converter::Html

def add_syntax_highlighter_to_class_attr(attr, lang = nil)

overwrites or add a "language-LANG" part using the +lang+ parameter if +lang+ is not nil.
Add the syntax highlighter name to the 'class' attribute of the given attribute hash. And
def add_syntax_highlighter_to_class_attr(attr, lang = nil)
  (attr['class'] = (attr['class'] || '') + " highlighter-#{@options[:syntax_highlighter]}").lstrip!
  attr['class'].sub!(/\blanguage-\S+|(^)/) { "language-#{lang}#{$1 ? ' ' : ''}" } if lang
end