public Method

BlueCloth.encode_html( str )

Return a copy of str with angle brackets and ampersands HTML-encoded.

Source Code

# File bluecloth.rb, line 1131
def encode_html( str )
        str.gsub( /&(?!#?[x]?(?:[0-9a-f]+|\w+);)/i, "&" ).
                gsub( %r{<(?![a-z/?\$!])}i, "&lt;" )
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.