Jekyll::Hooks.register :documents, :post_render do |doc| if doc.output_ext == ".html" doc.output = doc.output.gsub( /(.*?)<\/h[1-6]>/, '\5' ) end end