Sha256: fba55f5dc6d209937fca9af5695a078434813a4636ded478eabd2017f0ebc7d6

Contents?: true

Size: 399 Bytes

Versions: 51

Compression:

Stored size: 399 Bytes

Contents

module Nanoc::CLI::StreamCleaners
  # Simplifies output by replacing UTF-8 characters with their ASCII decompositions.
  #
  # @api private
  class UTF8 < Abstract
    # @see Nanoc::CLI::StreamCleaners::Abstract#clean
    def clean(s)
      # FIXME: this decomposition is not generally usable
      s.gsub(/“|”/, '"').gsub(/‘|’/, '\'').gsub('…', '...').gsub('©', '(c)')
    end
  end
end

Version data entries

51 entries across 51 versions & 1 rubygems

Version Path
nanoc-4.1.0rc1 lib/nanoc/cli/stream_cleaners/utf8.rb
nanoc-4.1.0b1 lib/nanoc/cli/stream_cleaners/utf8.rb
nanoc-4.1.0a1 lib/nanoc/cli/stream_cleaners/utf8.rb
nanoc-4.0.2 lib/nanoc/cli/stream_cleaners/utf8.rb
nanoc-4.0.1 lib/nanoc/cli/stream_cleaners/utf8.rb
nanoc-4.0.0 lib/nanoc/cli/stream_cleaners/utf8.rb
nanoc-4.0.0rc3 lib/nanoc/cli/stream_cleaners/utf8.rb
nanoc-4.0.0rc2 lib/nanoc/cli/stream_cleaners/utf8.rb
nanoc-4.0.0rc1 lib/nanoc/cli/stream_cleaners/utf8.rb
nanoc-4.0.0b4 lib/nanoc/cli/stream_cleaners/utf8.rb
nanoc-4.0.0b3 lib/nanoc/cli/stream_cleaners/utf8.rb