Method: Arrow::HTMLTag#escape_html

Defined in:
lib/arrow/htmltokenizer.rb

#escape_html(string) ⇒ Object

Escape special characters in the given string for display in an HTML inspection interface.



312
313
314
315
316
317
318
319
# File 'lib/arrow/htmltokenizer.rb', line 312

def escape_html( string )
	return "nil" if string.nil?
	string = string.inspect unless string.is_a?( String )
	string.
		gsub(/&/, '&').
		gsub(/</, '&lt;').
		gsub(/>/, '&gt;')
end