function itemDescrpt = itemDescriptWLink(mdlObj, sid, modelname, linkInfo, createLink, isXilData) 
%

%   Copyright 2018-2023 The MathWorks, Inc.
    

    if createLink == 0 || (isXilData && is_shared_util(mdlObj))
        itemDescrpt = {struct('url', '', 'disp', mdlObj.descr, 'type', 'char')};
    else
        allText = mdlObj.descr;
        
        
        if contains(allText,'State "')
            tok = regexp(allText, 'State "(.+)"','tokens');
            link = Sldv.ReportUtils.externalLink(sid ,tok{1}{1},modelname,...
                false,[],linkInfo);
            itemDescrpt = {Sldv.ReportUtils.styleStructCat('State "', link , '"')};
        elseif contains(allText,'Transition "')
            tok = regexp(allText, 'Transition "(.+?)"(.+)','tokens');
            link = Sldv.ReportUtils.externalLink(sid ,tok{1}{1},modelname,...
                false,[],linkInfo);
            itemDescrpt = {Sldv.ReportUtils.styleStructCat('Transition "', link , sprintf('"%s',tok{1}{2}))};
        else
            itemDescrpt = { Sldv.ReportUtils.externalLink(sid ,mdlObj.descr,modelname,...
                false,[], linkInfo) };
        end
    end
end            


function out = is_shared_util(mdlObj)
    out = strcmp(mdlObj.descr,sldv.code.xil.ReportDataUtils.SHARED_UTILITY_LABEL);
end
