1self.addEventListener('message', function (e) { 2 var data = e.data; 3 var highlightTexts = []; 4 data.regexPatterns.forEach(function (pattern) { 5 var matchTexts = data.input.match(new RegExp(pattern.highlight, 'gi')); 6 if (matchTexts) { 7 matchTexts.forEach(function (text) { 8 highlightTexts.push({ 9 id: pattern.id, 10 highlight: text, 11 className: 'external-invitation-words-' + pattern.id 12 }); 13 }); 14 } 15 }); 16 self.postMessage(highlightTexts); 17});
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.