Sha256: 8adc3c1b620980c5e383f0a0d1335e7ef5305ff2693ee468435152571d61b9ce

Contents?: true

Size: 648 Bytes

Versions: 5

Compression:

Stored size: 648 Bytes

Contents

module Filters
  module PostFilter
    def format_admonitions!(html)
      html.gsub!(/<p>#{Filters.front_wrap}\s*#tip\s*#{Filters.end_wrap}<\/p>/,     '<div class="alert tip">')
      html.gsub!(/<p>#{Filters.front_wrap}\s*#note\s*#{Filters.end_wrap}<\/p>/,    '<div class="alert note">')
      html.gsub!(/<p>#{Filters.front_wrap}\s*#warning\s*#{Filters.end_wrap}<\/p>/, '<div class="alert warning">')
      html.gsub!(/<p>#{Filters.front_wrap}\s*#danger\s*#{Filters.end_wrap}<\/p>/,   '<div class="alert danger">')
      html.gsub!(/<p>#{Filters.front_wrap}\s*\/(tip|note|warning|danger)\s*#{Filters.end_wrap}<\/p>/, '</div>')
    end
  end
end

Version data entries

5 entries across 5 versions & 1 rubygems

Version Path
extended-markdown-filter-0.4.4 lib/filters/post/admonition.rb
extended-markdown-filter-0.4.3 lib/filters/post/admonition.rb
extended-markdown-filter-0.4.2 lib/filters/post/admonition.rb
extended-markdown-filter-0.4.1 lib/filters/post/admonition.rb
extended-markdown-filter-0.4.0 lib/filters/post/admonition.rb