Method: BlueFeather::Parser#encode_code
- Defined in:
- lib/bluefeather.rb
#encode_code(str, rs) ⇒ Object
Escape any characters special to HTML and encode any characters special to Markdown in a copy of the given str and return it.
2008 2009 2010 2011 2012 2013 |
# File 'lib/bluefeather.rb', line 2008 def encode_code( str, rs ) str.gsub( %r{&}, '&' ). gsub( %r{<}, '<' ). gsub( %r{>}, '>' ). gsub( CodeEscapeRegexp ) {|match| EscapeTable[match][:md5]} end |