Sha256: ad1ddaee34b8225d7f74072b7fddd227858fa3f1e4538bdf47f87eccbd61bbaa

Contents?: true

Size: 510 Bytes

Versions: 16

Compression:

Stored size: 510 Bytes

Contents

module EvilFront::Helpers
  # Insert non-break spaces and mark quotes to have nice text.
  # Work only with English language.
  #
  #   = english_typograph user.description
  #
  # You can send block:
  #
  #   = english_typograph do
  #     = user.name
  #     = user.profession
  def english_typograph(text = nil, &block)
    text = if block_given?
      capture(&block)
    else
      EvilFront.escape(text)
    end
    text = EvilFront::English.typograph_html(text)
    EvilFront.html_safe(text)
  end
end

Version data entries

16 entries across 16 versions & 1 rubygems

Version Path
evil-front-0.5.1 lib/evil-front/helpers/english_typograph.rb
evil-front-0.5.0 lib/evil-front/helpers/english_typograph.rb
evil-front-0.4.0 lib/evil-front/helpers/english_typograph.rb
evil-front-0.3.10 lib/evil-front/helpers/english_typograph.rb
evil-front-0.3.9 lib/evil-front/helpers/english_typograph.rb
evil-front-0.3.8 lib/evil-front/helpers/english_typograph.rb
evil-front-0.3.7 lib/evil-front/helpers/english_typograph.rb
evil-front-0.3.6 lib/evil-front/helpers/english_typograph.rb
evil-front-0.3.5 lib/evil-front/helpers/english_typograph.rb
evil-front-0.3.4 lib/evil-front/helpers/english_typograph.rb
evil-front-0.3.3 lib/evil-front/helpers/english_typograph.rb
evil-front-0.3.2 lib/evil-front/helpers/english_typograph.rb
evil-front-0.3.1 lib/evil-front/helpers/english_typograph.rb
evil-front-0.3.0 lib/evil-front/helpers/english_typograph.rb
evil-front-0.2.1 lib/evil-front/helpers/english_typograph.rb
evil-front-0.2.0 lib/evil-front/helpers/english_typograph.rb