Sha256: 64ca7ebcff64ce2065e6113d46a89be8195afe275aad0ac6cbdad683c1082a17

Contents?: true

Size: 469 Bytes

Versions: 6

Compression:

Stored size: 469 Bytes

Contents

module ImproveTypography
  module Processors
    class DoubleQuotes < Processor
      REGEXP = /["“”](.*?)["“”]/i

      def call
        replace_double_quotes
      end

      private

      def replace_double_quotes
        str.gsub(REGEXP, "#{double_quotes[0]}\\1#{double_quotes[1]}" )
      end

      def double_quotes
        options.fetch(:double_quotes, I18n.t(:double_quotes, scope: %i(improve_typography), locale: locale))
      end
    end
  end
end

Version data entries

6 entries across 6 versions & 1 rubygems

Version Path
improve_typography-0.1.11 lib/improve_typography/processors/double_quotes.rb
improve_typography-0.1.10 lib/improve_typography/processors/double_quotes.rb
improve_typography-0.1.9 lib/improve_typography/processors/double_quotes.rb
improve_typography-0.1.8 lib/improve_typography/processors/double_quotes.rb
improve_typography-0.1.7 lib/improve_typography/processors/double_quotes.rb
improve_typography-0.1.6 lib/improve_typography/processors/double_quotes.rb