Strip class name

Used to create a Nitunit test class name from a CommonMark section title.

Property definitions

markdown2 $ TestGenerator :: strip_class_name
	# Strip class name
	#
	# Used to create a Nitunit test class name from a CommonMark section title.
	fun strip_class_name(name: String): String do
		var b = new FlatBuffer
		var was_space = false
		for c in name do
			if c == ' ' then
				was_space = true
			else
				if not c.is_letter and
				   not c.is_digit and
				   not allowed_id_chars.has(c) then continue
				if was_space then
					b.add c.to_upper
					was_space = false
				else
					b.add c
				end
			end
		end
		return b.to_s
	end
lib/markdown2/tests/commonmark_gen.nit:123,2--145,4