Module: Wikilink::Converter::HTMLAttributes

Included in:
Namespace, Sites::RubyChina
Defined in:
lib/wikilink/converter/utils.rb

Instance Method Summary collapse

Instance Method Details

#html_class(extra_classes = nil) ⇒ Object



43
44
45
46
47
48
49
50
51
52
53
# File 'lib/wikilink/converter/utils.rb', line 43

def html_class(extra_classes = nil)
  classes = []
  if respond_to? :options
    classes << options[:class]
    classes << 'external' if options[:external]
  end

  classes << extra_classes if extra_classes

  classes.flatten.join(' ').split.uniq.join(' ')
end