javascript - Highlight a text from a URL -


i new angularjs. have file in html format.consider resume in html format. here want highlight words file ,here when word present in link messing html file. so, because of not able show html file ? so, how can highlight word links ? there reg-ex can me ? . have gone through lot of questions .

highlighting filtered result in angularjs

i have seen same thing doing ,

my code -

$scope.highlighthtml = function (content, text, classname, notbywordboundry) {     var regexpescapetext, str;     if (!(content && content.replace)) {         return '';     }     if (!text) {         return $sce.trustashtml(content);     }     if (!classname) {         classname = 'mark';     }     regexpescapetext = text.replace(/[.?*+^$[\]\\(){}|-]/g, "\\$&");     if (!notbywordboundry) {          str = new regexp('(\\b)' + regexpescapetext + '(\\b)', 'gi');     } else {          str = new regexp(regexpescapetext, 'gi');     }     return content.replace(str, '<span tabindex="1" class="' + classname + '">$&</span>'); }; 

here content whole html file , text word needs highlighted ? in advance.


Comments

Popular posts from this blog

Command prompt result in label. Python 2.7 -

javascript - How do I use URL parameters to change link href on page? -

amazon web services - AWS Route53 Trying To Get Site To Resolve To www -