Sha256: 64af51d3d265a0d34e133da8c0795261c0daf859f5350766382b276eefe67600

Contents?: true

Size: 420 Bytes

Versions: 5

Compression:

Stored size: 420 Bytes

Contents

require 'nishisuke_blog_syntax/formatter'

module NishisukeBlogSyntax
  module Formatter
    class HeadThreeFormatter < FormatterBase
      SUBSTITUTE_REGEXP = /^### .*$/
      PARSE_REGEXP = /^### (.*)$/

      private

      def regexp
        SUBSTITUTE_REGEXP
      end

      def substitute(matched)
        content_str = matched.match(PARSE_REGEXP)[1]
        "<h3>#{content_str}</h3>"
      end
    end
  end
end

Version data entries

5 entries across 5 versions & 2 rubygems

Version Path
nishisuke_blog_syntax-0.1.8 lib/nishisuke_blog_syntax/formatter/head_three_formatter.rb
nishisuke-blog-syntax-0.1.7 lib/nishisuke_blog_syntax/formatter/head_three_formatter.rb
nishisuke-blog-syntax-0.1.6 lib/nishisuke_blog_syntax/formatter/head_three_formatter.rb
nishisuke-blog-syntax-0.1.5 lib/nishisuke_blog_syntax/formatter/head_three_formatter.rb
nishisuke-blog-syntax-0.1.4 lib/nishisuke_blog_syntax/formatter/head_three_formatter.rb