Method: Mathemagical.encode
- Defined in:
- lib/mathemagical.rb
.encode(s) ⇒ Object
14 15 16 17 18 19 |
# File 'lib/mathemagical.rb', line 14 def self.encode(s) @entities ||= HTMLEntities.new # TODO: HTMLEntities Y U DOUBLE ENCODE?? @entities.encode(s).gsub(/&([#a-zA-Z0-9]{2,24});/, '&\1;') end |