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

normalize_source_filter.rb « filter « banzai « lib - gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
blob: 975cd5408730f62255df0d644cad1c1241522ef5 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
# frozen_string_literal: true

module Banzai
  module Filter
    class NormalizeSourceFilter < HTML::Pipeline::Filter
      UTF8_BOM = "\xEF\xBB\xBF"

      def call
        # Remove UTF8_BOM from beginning of source text
        html.delete_prefix(UTF8_BOM)
      end
    end
  end
end