Skip to content

Commit

Permalink
Merge branch 'patternfly:main' into main
Browse files Browse the repository at this point in the history
  • Loading branch information
wise-king-sullyman authored Feb 2, 2024
2 parents 9249266 + 9099f62 commit 2c70b21
Showing 1 changed file with 2 additions and 9 deletions.
11 changes: 2 additions & 9 deletions packages/module/src/LogViewer/LogViewerRow.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
import React, { memo, useContext } from 'react';
import ReactDOMServer from 'react-dom/server';
import { LOGGER_LINE_NUMBER_INDEX_DELTA } from './utils/constants';
import { css } from '@patternfly/react-styles';
import styles from '@patternfly/react-styles/css/components/LogViewer/log-viewer';
Expand Down Expand Up @@ -51,16 +50,10 @@ export const LogViewerRow: React.FunctionComponent<LogViewerRowProps> = memo(({
composedString.push(str);
} else {
const splitString = str.split(regEx);
splitString.forEach((substr, newIndex) => {
splitString.forEach((substr) => {
if (substr.match(regEx)) {
matchCounter += 1;
composedString.push(
ReactDOMServer.renderToString(
<span className={css(styles.logViewerString, handleHighlight(matchCounter))} key={newIndex}>
{substr}
</span>
)
);
composedString.push(`<span class="${css(styles.logViewerString, handleHighlight(matchCounter))}">${substr}</span>`);
} else {
composedString.push(escapeTextForHtml(substr));
}
Expand Down

0 comments on commit 2c70b21

Please sign in to comment.