Website: Update syntax highlighting on osquery schema pages (#25894)

Closes: #25893


Changes:
- Updated the syntax highlighting on schema table pages to not try to
match column names that are less than two characters long. (This only
affects syntax highlighting on the `/tables/ioreg` page)
This commit is contained in:
Eric 2025-01-30 11:36:25 -06:00 committed by GitHub
parent 8d9ca0eabf
commit 4a8a054a8a
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -89,6 +89,11 @@ parasails.registerPage('osquery-table-details', {
// $(block).html(replacementHMTL);
let columnNamesToHighlight = [];// Empty array to track the keywords that we will need to highlight
for(let keyword of keywordsForThisTable){// Going through the array of keywords for this table, if the entire word matches, we'll add it to the
// Skip column names that are less than two characters long.
// We do this because some tables (ioreg) have columns that have single characacter names, which can be inaccuratly matched.
if(keyword.length < 2) {
continue;
}
for(let match of block.innerHTML.match(keyword)||[]){
columnNamesToHighlight.push(match);
}