@mikezimm/fps-library-v2
Version:
Library of reusable typescript/javascript functions, interfaces and constants
12 lines • 596 B
JavaScript
import * as React from 'react';
// 2024-07-29: Migrated from HubCon
export function highlightStringBetweenB(str, highlight) {
const splits = str.split('\\b');
if (splits.length !== 3)
return React.createElement("span", { style: { backgroundColor: highlight === true ? 'yellow' : null } }, str);
return React.createElement("span", null,
React.createElement("span", null, `${splits[0]}\\b`),
React.createElement("span", null, `${splits[1]}`),
React.createElement("span", null, `\\b${splits[2]}`));
}
//# sourceMappingURL=highlightRegex.js.map