From 41b597c736bebdb0872efc313e5f37b016de0b85 Mon Sep 17 00:00:00 2001 From: Eric Rozell Date: Wed, 19 Feb 2025 17:41:35 -0800 Subject: [PATCH] Move U+200E character to first fragment (#49534) Summary: Pull Request resolved: https://github.com/facebook/react-native/pull/49534 Moving the U+200E character ensures that it gets the same font style as other fragments in the LogBox inspector. This solves an issue where the line height differential is causing issues on some out-of-tree platforms (e.g., Windows). ## Changelog [Internal] Reviewed By: shwanton Differential Revision: D69857916 fbshipit-source-id: 5bc70dc0282f3ef9e9b2767ab8094e9923638e99 --- packages/react-native/Libraries/LogBox/UI/AnsiHighlight.js | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/packages/react-native/Libraries/LogBox/UI/AnsiHighlight.js b/packages/react-native/Libraries/LogBox/UI/AnsiHighlight.js index b7163f1512f..827ff8d7c68 100644 --- a/packages/react-native/Libraries/LogBox/UI/AnsiHighlight.js +++ b/packages/react-native/Libraries/LogBox/UI/AnsiHighlight.js @@ -70,7 +70,9 @@ export default function Ansi({ /* $FlowFixMe[missing-local-annot] The type annotation(s) required by Flow's * LTI update could not be added via codemod */ const getText = (content, key) => { - if (key === 1) { + if (key === 0) { + return LRM + content; + } else if (key === 1) { // Remove the vertical bar after line numbers return content.replace(/\| $/, ' '); } else if (key === 2 && commonWhitespaceLength < Infinity) { @@ -86,7 +88,6 @@ export default function Ansi({ {parsedLines.map((items, i) => ( - {LRM} {items.map((bundle, key) => { const textStyle = bundle.fg && COLORS[bundle.fg]