lib/wparser/inline/heading.rb in wparser-0.0.2 vs lib/wparser/inline/heading.rb in wparser-0.1.0
- old
+ new
@@ -1,9 +1,10 @@
-module Heading
- def parse line
- parse_line = line.sub(/^h([1-6])\.\s(.*)\n/){|s| "<h#$1>#$2</h#$1>\n" }
- return line if parse_line == nil
- parse_line
- end
+require 'wparser/parse'
- module_function :parse
+module Inlines
+ class Heading < Parse
+ def self.parse line
+ @result = line.sub(/^h([1-6])\.\s(.*)\n/){|s| "<h#$1>#$2</h#$1>\n"}
+ super
+ end
+ end
end