lib/maruku/input/parse_doc.rb
def expand_attribute_list(al, result)
    al.each do |k, v|
      case k
      when :class
        if result[:class]
          result[:class] << " " << v
        else
          result[:class] = v
        end
      when :id
        result[:id] = v
      when :ref
        if self.ald[v]
          already = (result[:expanded_references] ||= [])
          if !already.include?(v)
            already << v
            expand_attribute_list(self.ald[v], result)
          else
            already << v
            maruku_error "Circular reference between labels.\n\n" +
            "Label #{v.inspect} calls itself via recursion.\nThe recursion is " +
              already.map(&:inspect).join(' => ')
          end
        else
          if result[:unresolved_references]
            result[:unresolved_references] << " " << v
          else
            result[:unresolved_references] = v
          end

          # $stderr.puts "Unresolved reference #{v.inspect} (avail: #{self.ald.keys.inspect})"
          result[v.to_sym] = true
        end
      else
        result[k.to_sym] = v
      end
    end
  end
# Expands an attribute list in an Hash
Expands an attribute list in an Hash
Expands an attribute list in an Hash
def expand_attribute_list(al, result)
    al.each do |k, v|
      case k
      when :class
        if result[:class]
          result[:class] << " " << v
        else
          result[:class] = v
        end
      when :id
        result[:id] = v
      when :ref
        if self.ald[v]
          already = (result[:expanded_references] ||= [])
          if !already.include?(v)
            already << v
            expand_attribute_list(self.ald[v], result)
          else
            already << v
            maruku_error "Circular reference between labels.\n\n" +
            "Label #{v.inspect} calls itself via recursion.\nThe recursion is " +
              already.map(&:inspect).join(' => ')
          end
        else
          if result[:unresolved_references]
            result[:unresolved_references] << " " << v
          else
            result[:unresolved_references] = v
          end
          result[v.to_sym] = true
        end
      else
        result[k.to_sym] = v
      end
    end
  end
def expand_attribute_list ( al , result ) al . each do | k , v | case k when :class if result [ :class ] result [ :class ] << " " << v else result [ :class ] = v end when :id result [ :id ] = v when :ref if self . ald [ v ] already = ( result [ :expanded_references ] ||= [ ] ) if ! already . include? ( v ) already << v expand_attribute_list ( self . ald [ v ] , result ) else already << v maruku_error "Circular reference between labels.\n\n" + "Label #{v.inspect} calls itself via recursion.\nThe recursion is " + already . map ( & :inspect ) . join ( ' => ' ) end else if result [ :unresolved_references ] result [ :unresolved_references ] << " " << v else result [ :unresolved_references ] = v end result [ v . to_sym ] = true end else result [ k . to_sym ] = v end end end
Expands an attribute list in an Hash
Expands an attribute list in an Hash
# $stderr.puts "Unresolved reference #{v.inspect} (avail: #{self.ald.keys.inspect})"
al
result