Class: MarkdownFeature
- Inherits:
-
Object
show all
- Defined in:
- lib/jay_flavored_markdown/markdown_converter.rb
Class Method Summary
collapse
Instance Method Summary
collapse
Class Method Details
.create(type) ⇒ Object
142
143
144
145
146
147
148
149
|
# File 'lib/jay_flavored_markdown/markdown_converter.rb', line 142
def self.create(type)
case type
when :item
ListItemFeature.new
when :section
SectionFeature.new
end
end
|
Instance Method Details
#create_counter ⇒ Object
159
160
161
|
# File 'lib/jay_flavored_markdown/markdown_converter.rb', line 159
def create_counter
LeveledCounter.create(type).next_level
end
|
#indent_length(line) ⇒ Object
155
156
157
|
# File 'lib/jay_flavored_markdown/markdown_converter.rb', line 155
def indent_length(line)
indent =~ line ? $1.length : 0
end
|
#match_start_regexp?(string) ⇒ Boolean
151
152
153
|
# File 'lib/jay_flavored_markdown/markdown_converter.rb', line 151
def match_start_regexp?(string)
start_regexp =~ string
end
|
#select_counter(counters) ⇒ Object
163
164
165
|
# File 'lib/jay_flavored_markdown/markdown_converter.rb', line 163
def select_counter(counters)
counters.find {|item| item.type == type}
end
|