rbowen / centos / centos.org

Forked from centos/centos.org 3 years ago
Clone

Blame lib/filters/remove_spacing_around_pre.rb

e8ec7a
module Nanoc3::Filters
e8ec7a
e8ec7a
  class RemoveSpacingRoundPre < Nanoc3::Filter
e8ec7a
e8ec7a
    identifiers :remove_spacing_around_pre
e8ec7a
e8ec7a
    def run(content, arguments={})
e8ec7a
      content.gsub(/<pre( title="[^"]+")?><code( class="language-[a-z]+")?>\n/) { |m| m[0..-2] }
e8ec7a
    end
e8ec7a
e8ec7a
  end
e8ec7a
e8ec7a
end