/* This Source Code Form is subject to the terms of the Mozilla Public * License, v. 2.0. If a copy of the MPL was not distributed with this * file, You can obtain one at . */ // Maybe reuse file search's functions? import React from "react"; export function highlightMatches(lineMatch) { const { value, matchIndex, match } = lineMatch; const len = match.length; return ( {value.slice(0, matchIndex)} {value.substr(matchIndex, len)} {value.slice(matchIndex + len, value.length)} ); }