Sha256: 3b61d283b1bec56be3ec91735a25cfcf8fcc5e74c8574e2a827b0a7bb6efcf13
Contents?: true
Size: 473 Bytes
Versions: 2
Compression:
Stored size: 473 Bytes
Contents
require 'nishisuke_blog_syntax/formatter' module NishisukeBlogSyntax module Formatter class ParagraphFormatter < FormatterBase SUBSTITUTE_REGEXP = /^>>>(.*?)<<<$/m PARSE_REGEXP = /^>>>(.*)<<<$/m private def regexp SUBSTITUTE_REGEXP end def substitute(matched) content_str = matched.match(PARSE_REGEXP)[1] content_str.gsub!(/\R|\s+/, ' ') "<p>#{content_str.chop}</p>" end end end end
Version data entries
2 entries across 2 versions & 2 rubygems
Version | Path |
---|---|
nishisuke_blog_syntax-0.1.8 | lib/nishisuke_blog_syntax/formatter/paragraph_formatter.rb |
nishisuke-blog-syntax-0.1.7 | lib/nishisuke_blog_syntax/formatter/paragraph_formatter.rb |