Class: ClWiki::FormatBlockquote
- Inherits:
-
CustomFormatter
- Object
- CustomFormatter
- ClWiki::FormatBlockquote
- Defined in:
- lib/cl_wiki/format_blockquote.rb
Class Method Summary collapse
Class Method Details
.format_content(content, page) ⇒ Object
9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 |
# File 'lib/cl_wiki/format_blockquote.rb', line 9 def self.format_content(content, page) if content # I wanted to bring this in, similar to my last change to # format_pre_blockquote.rb. But somehow this is impacting how # @content.each_line works in convert_newline_to_br leading to # unexpected results there. I can't figure it out right now and this # isn't that important, so I'm not going to do it right now. # Remove 0 or 1 newline at the front of the block # content.gsub!(/\[\]\n?/, '<blockquote>') # Remove 0 to 2 newlines after the block to keep things tidy. # content.gsub!(%r{\[/\]\n{0,2}}, '</blockquote>') content.gsub!(/\[\]/, '<blockquote>') content.gsub!(%r{\[/\]}, '</blockquote>') content end end |
.match_re ⇒ Object
5 6 7 |
# File 'lib/cl_wiki/format_blockquote.rb', line 5 def self.match_re %r{\[\].*\[/\]}m end |