Sha256: d66de05ee1b715cf26417f0e682295013598539293c14ca2fdec4147d0400b55

Contents?: true

Size: 320 Bytes

Versions: 4

Compression:

Stored size: 320 Bytes

Contents


class MDElement
	
	# Strips all formatting from the string
	def to_s
		 children_to_s
	end
	
	def children_to_s
		@children.join
	end
	
	# Generate an id for headers. Assumes @children is set.
	def generate_id
		title = children_to_s
		title.gsub!(/ /,'_')
		title.downcase!
		title.gsub!(/[^\w_]/,'')
		title
	end
end

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
maruku-0.2.5 lib/maruku/to_s.rb
maruku-0.2.8 lib/maruku/to_s.rb
maruku-0.2.6 lib/maruku/to_s.rb
maruku-0.2.7 lib/maruku/to_s.rb