class NishisukeBlogSyntax::Formatter::ParagraphFormatter

Constants

PARSE_REGEXP
SUBSTITUTE_REGEXP

Private Instance Methods

regexp() click to toggle source
# File lib/nishisuke_blog_syntax/formatter/paragraph_formatter.rb, line 11
def regexp
  SUBSTITUTE_REGEXP
end
substitute(matched) click to toggle source
# File lib/nishisuke_blog_syntax/formatter/paragraph_formatter.rb, line 15
def substitute(matched)
  content_str = matched.match(PARSE_REGEXP)[1]
  content_str.gsub!(/\R|\s+/, ' ')
  "<p>#{content_str.chop}</p>"
end