Skip to content

Instantly share code, notes, and snippets.

View vancura's full-sized avatar
🤓
Kuju pixle!

Václav Vančura vancura

🤓
Kuju pixle!
View GitHub Profile
@vancura
vancura / typo.rb
Created October 5, 2010 14:19 — forked from tomasc/typo.rb
Typographic conversion regexps
def three_periods_to_ellipsis
self.gsub("...", "…")
end
def straight_double_quotes_to_smart_double_quotes
self.gsub(/\B"\b([^"“”„‟″‶\r\n]+)\b"\B/, '“\1”')
end
def straight_single_quotes_to_smart_single_quotes
self.gsub(/\B'\b([^'‘’‚‛′‵\r\n]+)\b'\B/, '‘\1’')