function dctProfStripAnchors
% DCTPROFSTRIPANCHORS Removes anchors that evaluate MATLAB code from 
% Parallel Profiler HTML.
% It displays stripped-down HTML from the Profiler in a new
% HTML window, thereby allowing users to compare two profiling runs
% without causing problems with stale file information. No temporary images
% are currently copied.
%   See also STRIPANCHORS, MPIPROFILE, MPIPROFVIEW.

%   Copyright 2007-2013 The MathWorks, Inc.

%   2007 smarvasti based on stripanchors.m

if ~iIsOnClient()
    if labindex==1
        runCmdOnClient('dctProfStripAnchors');
        return;
    else % dont do anything on other labs
        return;
    end
end
str = char(com.mathworks.mde.profiler.OldProfiler.getHtmlTextParallel);

% The question mark makes the .* wildcard non-greedy
str = regexprep(str,'<a.*?>','');
str = regexprep(str,'</a>','');
str = regexprep(str,'<form.*?</form>','');
str = regexprep(str,'<form.*?</form>','');
str = regexprep(str,'<table name="topMenuTable".*?</table>','');

str = strrep(str,'<body>','<body bgcolor="#F8F8F8"><strong>Links are disabled because this is a static copy of a profile report</strong><p>');

web('-new', '-noaddressbox', ['text://' str]);

%--------------------------------------------------------------------------
%--------------------------------------------------------------------------
function onclient = iIsOnClient()
onclient = ~system_dependent('isdmlworker');

