Method: Wikilink::Converter::Namespace::Default#run

Defined in:
lib/wikilink/converter/namespace.rb

#run(run_options) ⇒ Object



31
32
33
34
35
36
37
38
39
40
41
42
43
44
# File 'lib/wikilink/converter/namespace.rb', line 31

def run(run_options)
  return super if @block

  path = run_options[:path].to_s
  path, fragment = path.split('#', 2)
  path, query = path.split('?', 2)

  fragment = '#' + fragment if fragment
  query = '?' + query if query

  url = to_url(path, fragment, query)

  link_to(run_options[:name], url, :class => html_class(run_options[:class]))
end