Welcome to mirror list, hosted at ThFree Co, Russian Federation.

html_entity_filter.rb « filter « banzai « lib - gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
blob: f3bd587c28bbf92a333d408a4b2bdf5a6ddc538e (plain)
1
2
3
4
5
6
7
8
9
10
11
12
require 'erb'

module Banzai
  module Filter
    # Text filter that escapes these HTML entities: & " < >
    class HtmlEntityFilter < HTML::Pipeline::TextFilter
      def call
        ERB::Util.html_escape_once(text)
      end
    end
  end
end