Sha256: 1b312706d01ed4169f5db22bf824d1e4087f3ee67c34409e0a711bf075f075e4

Contents?: true

Size: 992 Bytes

Versions: 43

Compression:

Stored size: 992 Bytes

Contents

require 'rabbit/parser/rd/ext/base'
require 'rabbit/parser/rd/ext/image'

module Rabbit
  module Parser
    class RD
      module Ext
        class Refer < Base
          include Image

          def default_ext_refer(label, source, content, visitor)
            ref = ReferText.new(content)
            ref.to = label.element_label
            ref
          end

          # For backward compatibility.
#         def ext_refer_img(label, content, visitor)
#           img(label, content, visitor)
#         end

          def ext_refer_quote(label, source, content, visitor)
            return nil unless /^quote:(.*)$/ =~ label.element_label
            quoted_name = $1
            quoted_label = ::RD::Reference::RDLabel.new(quoted_name,
                                                        label.filename)
            source = quoted_label.to_s if label.to_s == source
            default_ext_refer(quoted_label, source, content)
          end
        end
      end
    end
  end
end

Version data entries

43 entries across 43 versions & 1 rubygems

Version Path
rabbit-3.0.3 lib/rabbit/parser/rd/ext/refer.rb
rabbit-3.0.2 lib/rabbit/parser/rd/ext/refer.rb
rabbit-3.0.1 lib/rabbit/parser/rd/ext/refer.rb
rabbit-3.0.0 lib/rabbit/parser/rd/ext/refer.rb
rabbit-2.2.1 lib/rabbit/parser/rd/ext/refer.rb
rabbit-2.2.0 lib/rabbit/parser/rd/ext/refer.rb
rabbit-2.1.9 lib/rabbit/parser/rd/ext/refer.rb
rabbit-2.1.8 lib/rabbit/parser/rd/ext/refer.rb
rabbit-2.1.7 lib/rabbit/parser/rd/ext/refer.rb
rabbit-2.1.6 lib/rabbit/parser/rd/ext/refer.rb
rabbit-2.1.5 lib/rabbit/parser/rd/ext/refer.rb
rabbit-2.1.4 lib/rabbit/parser/rd/ext/refer.rb
rabbit-2.1.3 lib/rabbit/parser/rd/ext/refer.rb
rabbit-2.1.2 lib/rabbit/parser/rd/ext/refer.rb
rabbit-2.1.1 lib/rabbit/parser/rd/ext/refer.rb
rabbit-2.1.0 lib/rabbit/parser/rd/ext/refer.rb
rabbit-2.0.9 lib/rabbit/parser/rd/ext/refer.rb
rabbit-2.0.8 lib/rabbit/parser/rd/ext/refer.rb
rabbit-2.0.7 lib/rabbit/parser/rd/ext/refer.rb
rabbit-2.0.6 lib/rabbit/parser/rd/ext/refer.rb