lib/wikilink/converter.rb in wikilink-converter-0.2.2 vs lib/wikilink/converter.rb in wikilink-converter-0.2.3

- old
+ new

@@ -62,29 +62,30 @@ else if inner.start_with?(':') colon = ':' inner = inner[1..-1] end + inner = inner.gsub(///, '/') link, name = inner.split('|', 2) path, namespace, site = link.split(':', 3).reverse if site.to_s.empty? && !namespace.to_s.empty? # if namespace is a valid site name, use it as site if site_converter(namespace) site = namespace namespace = nil end end - + if name.to_s.empty? name = resolve_name(inner, run_options) end # ignore malformed wikilink if valid?(site, namespace, path) run_options = run_options.merge(path: path, name: name, colon: colon) result = convert_link(site, namespace, run_options) - result ? ($1 + result) : match + result ? (prefix + result) : match else match end end end