Class: SpecialLatex
- Inherits:
-
Object
- Object
- SpecialLatex
- Defined in:
- lib/special_latex.rb
Class Method Summary collapse
Class Method Details
.convert(str) ⇒ Object
206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 |
# File 'lib/special_latex.rb', line 206 def self.convert(str) str.gsub(@command_regex) do |s| if @command_map.key?($1) then @command_map[$1] elsif not $4.empty? then combined = $1 + $4 if @ascii_map.key?(combined) then @ascii_map[combined] elsif @connecting_map.key?($1) then $4 + @connecting_map[$1] else s end else s end end end |