Welcome to mirror list, hosted at ThFree Co, Russian Federation.

document.rb « docs « gitlab « lib - gitlab.com/gitlab-org/gitlab-docs.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
blob: d4e486b242d6767634f0c738b0d9a86f3c98915d (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
module Gitlab
  module Docs
    class Document < Nokogiri::XML::SAX::Document
      def initialize(page)
        @page = page
      end

      def start_element(name, attributes = [])
        Gitlab::Docs::Element.new(name, attributes).tap do |element|
          @page.hrefs << element.href if element.link?
          @page.ids << element.id if element.has_id?
        end
      end
    end
  end
end