function str = html_escape(str)

% html_escape - very basic HTML escape 
% -------------------------------------
%
% str = html_escape(str)
%
% Input:
% ------
%  str - string to escape
%
% Output:
% -------
%  str - escaped string

%--------------------------------
% Author: Harold Figueroa
%--------------------------------
% $Revision: 2014 $
% $Date: 2005-10-25 17:43:52 -0400 (Tue, 25 Oct 2005) $
%--------------------------------

%--
% set some replacement patterns
%--

pat = {'<', '>', '"', '\'}; 

rep = {'&lt;', '&gt;', '&quot;', '\\'};

%--
% perform replacement
%--

for k = 1:length(pat)
	str = strrep(str,pat{k},rep{k});
end