public Method

BlueCloth.encode_code( str, rs )

Escape any characters special to HTML and encode any characters special to Markdown in a copy of the given str and return it.

Source Code

# File bluecloth.rb, line 1027
def encode_code( str, rs )
        str.gsub( %r{&}, '&' ).
                gsub( %r{<}, '&lt;' ).
                gsub( %r{>}, '&gt;' ).
                gsub( CodeEscapeRegexp ) {|match| EscapeTable[match][:md5]}
end
Comments

Have your say
Please use Textile formatting (click here for a cheat sheet). Use <code/> and <pre/> for code samples.
Click here to login with OpenID to to post comments.