Module: EvilFront::Typograph
Overview
Abstract module to be used in ‘Russian` and `English` typographs.
Instance Method Summary collapse
-
#typograph(text) ⇒ Object
Insert non-break spaces and mark quotes to have nice text.
-
#typograph_html(html) ⇒ Object
Like ‘typograph`, but process only text nodes in HTML.
Instance Method Details
#typograph(text) ⇒ Object
18 19 20 21 22 23 24 25 26 |
# File 'lib/evil-front/typograph.rb', line 18 def typograph(text) return text if text.nil? or text.empty? text.gsub! '"', '"' text = use_right_symbols(text) tiny_words.each { |regexp| text.gsub! regexp, "\\1\\2 " } text end |