Class: Undress::Textile

Inherits:
Grammar show all
Defined in:
lib/undress/textile.rb

Direct Known Subclasses

GreenCloth

Instance Attribute Summary

Attributes inherited from Grammar

#post_processing_rules, #pre_processing_rules, #whitelisted_attributes

Instance Method Summary collapse

Methods inherited from Grammar

#complete_word?, #content_of, default, inherited, #initialize, #method_missing, post_processing, post_processing_rules, pre_processing, pre_processing_rules, #process, process!, #process!, rule_for, #surrounded_by_whitespace?, whitelist_attributes, whitelisted_attributes

Constructor Details

This class inherits a constructor from Undress::Grammar

Dynamic Method Handling

This class handles dynamic methods through the method_missing method in the class Undress::Grammar

Instance Method Details

#attributes(node) ⇒ Object

:nodoc:



93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
# File 'lib/undress/textile.rb', line 93

def attributes(node) #:nodoc:
  filtered = super(node)

  if filtered
    
    if filtered.has_key?(:colspan)
      return "\\#{filtered[:colspan]}. "
    end

    if filtered.has_key?(:rowspan)
      return "/#{filtered[:rowspan]}. "
    end

    if filtered.has_key?(:lang)
      return "[#{filtered[:lang]}]"
    end

    if filtered.has_key?(:class) || filtered.has_key?(:id)
      klass = filtered.fetch(:class, "")
      id = filtered.fetch(:id, false) ? "#" + filtered[:id] : ""
      return "(#{klass}#{id})"
    end

    if filtered.has_key?(:style)
      return "{#{filtered[:style]}}"
    end
    ""
  end  
  ""
end