module StandaloneTypograf::Fractions::Processor

Public Class Methods

compile(text, mode) click to toggle source
# File lib/standalone_typograf/fractions.rb, line 12
def self.compile(text, mode)
  return text unless mode == :html
  text.gsub!(/(\s|^)(\d+)(\/)(\d+)(?:\s|$)/, '\1<sup>\2</sup>&frasl;<sub>\4</sub>')
  return text
end