Skip to content

Commit a7f8e68

Browse files
Merge pull request #40845 from GandalfGwaihir/issue40348
[Fix]: Preview with `HTML tags` can be seen in LHN chat preview
2 parents 33e73ef + dc3119f commit a7f8e68

File tree

1 file changed

+6
-3
lines changed

1 file changed

+6
-3
lines changed

src/components/LHNOptionsList/OptionRowLHN.tsx

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
import {useFocusEffect} from '@react-navigation/native';
2+
import ExpensiMark from 'expensify-common/lib/ExpensiMark';
23
import React, {useCallback, useRef, useState} from 'react';
34
import type {GestureResponderEvent, ViewStyle} from 'react-native';
45
import {StyleSheet, View} from 'react-native';
@@ -28,6 +29,8 @@ import CONST from '@src/CONST';
2829
import {isEmptyObject} from '@src/types/utils/EmptyObject';
2930
import type {OptionRowLHNProps} from './types';
3031

32+
const parser = new ExpensiMark();
33+
3134
function OptionRowLHN({reportID, isFocused = false, onSelectRow = () => {}, optionItem, viewMode = 'default', style, onLayout = () => {}, hasDraftComment}: OptionRowLHNProps) {
3235
const theme = useTheme();
3336
const styles = useThemeStyles();
@@ -59,8 +62,8 @@ function OptionRowLHN({reportID, isFocused = false, onSelectRow = () => {}, opti
5962
const textUnreadStyle = optionItem?.isUnread && optionItem.notificationPreference !== CONST.REPORT.NOTIFICATION_PREFERENCE.MUTE ? [textStyle, styles.sidebarLinkTextBold] : [textStyle];
6063
const displayNameStyle = [styles.optionDisplayName, styles.optionDisplayNameCompact, styles.pre, textUnreadStyle, style];
6164
const alternateTextStyle = isInFocusMode
62-
? [textStyle, styles.optionAlternateText, styles.pre, styles.textLabelSupporting, styles.optionAlternateTextCompact, styles.ml2, style]
63-
: [textStyle, styles.optionAlternateText, styles.pre, styles.textLabelSupporting, style];
65+
? [textStyle, styles.optionAlternateText, styles.textLabelSupporting, styles.optionAlternateTextCompact, styles.ml2, style]
66+
: [textStyle, styles.optionAlternateText, styles.textLabelSupporting, style];
6467

6568
const contentContainerStyles = isInFocusMode ? [styles.flex1, styles.flexRow, styles.overflowHidden, StyleUtils.getCompactContentContainerStyles()] : [styles.flex1];
6669
const sidebarInnerRowStyle = StyleSheet.flatten<ViewStyle>(
@@ -221,7 +224,7 @@ function OptionRowLHN({reportID, isFocused = false, onSelectRow = () => {}, opti
221224
numberOfLines={1}
222225
accessibilityLabel={translate('accessibilityHints.lastChatMessagePreview')}
223226
>
224-
{optionItem.alternateText}
227+
{parser.htmlToText(optionItem.alternateText)}
225228
</Text>
226229
) : null}
227230
</View>

0 commit comments

Comments
 (0)