Sha256: 199cb6f98f49cd1c19fe17573379401a653df58672f740c0efc43191849bba24

Contents?: true

Size: 1.28 KB

Versions: 5

Compression:

Stored size: 1.28 KB

Contents

# encoding: UTF-8

module Sterile
  # @private
  class Data
    def self.smart_format_rules
      [
        ["'tain't", "’tain’t"],
        ["'twere", "’twere"],
        ["'twas", "’twas"],
        ["'tis", "’tis"],
        ["'twill", "’twill"],
        ["'til", "’til"],
        ["'bout", "’bout"],
        ["'nuff", "’nuff"],
        ["'round", "’round"],
        ["'cause", "’cause"],
        ["'cos", "’cos"],
        ["i'm", "i’m"],
        ['--"', "—“"],
        ["--'", "—‘"],
        ["--", "—"],
        ["...", "…"],
        ["(tm)", "™"],
        ["(TM)", "™"],
        ["(c)", "©"],
        ["(r)", "®"],
        ["(R)", "®"],
        [/\'(\d\d)(?!’|\')([\p{P}\p{Z}])/, "’\\1\\2"],
        # [/<p>"/, "<p>\\1″"],
        [/s\'([^a-zA-Z0-9])/, "s’\\1"],
        [/"([:;])/, "”\\1"],
        [/\'s$/, "’s"],
        [/\'(\d\d(?:’|\')?s)/, "’\\1"],
        [/(\s|\A|"|\(|\[)\'/, "\\1‘"],
        # [/(\d+)"/, "\\1″"],
        # [/(\d+)\'/, "\\1′"],
        [/(\S)\'([^\'\s])/, "\\1’\\2"],
        [/(\s|\A|\(|\[)"(?!\s)/, "\\1“\\2"],
        [/"(\s|\S|\Z)/, "”\\1"],
        [/\'([\s.]|\Z)/, "’\\1"],
        [/(\d+)x(\d+)/, "\\1×\\2"],
        [/([a-z])'(t|d|s|ll|re|ve)(\b)/i, "\\1’\\2\\3"],
      ]
    end
  end
end

Version data entries

5 entries across 5 versions & 2 rubygems

Version Path
metanorma-cli-1.3.4 gems/ruby/2.6.0/gems/sterile-1.0.17/lib/sterile/data/smart_format_rules.rb
metanorma-cli-1.3.3.1 gems/ruby/2.6.0/gems/sterile-1.0.17/lib/sterile/data/smart_format_rules.rb
sterile-1.0.17 lib/sterile/data/smart_format_rules.rb
sterile-1.0.16 lib/sterile/data/smart_format_rules.rb
sterile-1.0.14 lib/sterile/data/smart_format_rules.rb