def resolve_links(text)
      html = Nokogiri::HTML.fragment(text)
      html.css("a[href]").each do |link|
        href = URI(link["href"])
        next unless href.relative? && markup_for_file(nil, href.path) == :markdown
        link.replace "{file:#{href} #{link.inner_html}}"
      end
      super(html.to_s)
    end
def resolve_links(text)
      html = Nokogiri::HTML.fragment(text)
      html.css("a[href]").each do |link|
        href = URI(link["href"])
        next unless href.relative? && markup_for_file(nil, href.path) == :markdown
        link.replace "{file:#{href} #{link.inner_html}}"
      end
      super(html.to_s)
    end
Resolves relative links to Markdown files.
 @param [String] text the HTML fragment in which to resolve links.
 @return [String] HTML with relative links to Markdown files converted to `{file:}` links.